From:             sdavey at datalink dot net dot au
Operating system: NA
PHP version:      4.3.2
PHP Bug Type:     Documentation problem
Bug description:  "Returning References" could do with more info

Description:
------------
The Returning References manual page contains the following comment:

"Note:  Unlike parameter passing, here you have to use & in both places -
to indicate that you return by-reference, not a copy as usual, and to
indicate that reference binding, rather than usual assignment, should be
done for $foo."

It refers to pass-by-reference, where you have to use the ampersand in
both the function *and* in the assignment of the function value to a
variable.

It is not clear what would happen if you didn't put the ampersand in both
places, and it would be nice to have someone explain this.

I'm a fairly seasoned PHP developer, but references are complex, and
judging by the user comments in various places in the manual concerning
them I think it would be great to have a sentance or two clarify this.

I know it's only a minor request, but for developers seeking to fine-tune
their code, understanding references is clearly the way to go.

Thanks, Scott.


-- 
Edit bug report at http://bugs.php.net/?id=26484&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26484&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26484&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26484&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26484&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26484&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26484&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26484&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26484&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26484&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26484&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26484&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26484&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26484&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26484&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26484&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26484&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26484&r=float

Reply via email to