ID: 26484 Updated by: [EMAIL PROTECTED] Reported By: sdavey at datalink dot net dot au -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: NA PHP Version: 4.3.2 New Comment:
It's illegal to omit one or the other & thus there is "you have to use & in both places". In current PHP versions (4.3.8, 5.0.0) it seems that & in function declaration is informative only but it can change in the future. Previous Comments: ------------------------------------------------------------------------ [2003-12-01 06:22:50] sdavey at datalink dot net dot au 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 this bug report at http://bugs.php.net/?id=26484&edit=1
