From:             bharat at menalto dot com
Operating system: FreeBSD 4.8
PHP version:      4.3.8
PHP Bug Type:     Scripting Engine problem
Bug description:  variable assign by reference works even when methods don't return by 
reference

Description:
------------
According to the documentation here:
http://us4.php.net/manual/en/language.references.return.php

In order to assign a variable as a reference to a value returned by a
class method, the method needs to also return by reference.  However, on
PHP 4.3.8 in my test script I've found that the semantics are the same
whether or not you return by reference.  

This is surprising to me.  I could have sworn that it didn't used to be
this way.  Please let me know if you need more information.  I can
reproduce this with a stock php.ini.

If this is the desired behaviour in this case, then we should update the
documentation to reflect that the ampersand is no longer necessary on the
getter method.

Reproduce code:
---------------
http://www.menalto.com/.outgoing/php/ref.php

Expected result:
----------------
The URL above indicates the expected results.  I can elaborate if
necessary.


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

Reply via email to