Req #8427 [Ana->Csd]: Unwanted references
| From: | jani@php.net | Date: | Wed, 01 Dec 2010 14:54:18 +0000 |
| Subject: | Req #8427 [Ana->Csd]: Unwanted references | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-156640@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=8427&edit=1
ID: 8427
Updated by: jani@php.net
Reported by: pkalliok at cs dot helsinki dot fi
Summary: Unwanted references
-Status: Analyzed
+Status: Closed
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: Any
PHP Version: 4.0.4
-Assigned To:
+Assigned To: jani
Block user comment: N
Private report: N
New Comment:
Not an issue anymore. If it is, post new report with proper example
scripts.
Previous Comments:
------------------------------------------------------------------------
[2003-01-18 14:19:58] moriyoshi@php.net
1) when setting a variable by reference from a part of array
or object, the value being set _from_ is also turned into
reference
This is not supposed to be a bug. See bug #20993.
2) object contained in other objects are turned into
references by settype() and calling their methods
This might be a bug, but this problem doesn't occur under ZendEngine2.
Stay tuned.
3) NULLs become references to NULLs when you set an object
from them by reference.
This is expected behaviour.
------------------------------------------------------------------------
[2000-12-26 13:31:46] pkalliok at cs dot helsinki dot fi
There are at least three places I know of where normal values are
silently turned into references:
- when setting a variable by reference from a part of array or object,
the value being set _from_ is also turned into reference
- object contained in other objects are turned into references by
settype() and calling their methods
- NULLs become references to NULLs when you set an object from them by
reference
Because this all alters the behaviour of PHP in subtle, dangerous ways,
makes debugging harder and because references have still bugs (for
example, serialisation), I ask you not to turn things into references
when I don't see there is any reason to. I understand it is your policy
that "turning a value into a reference should be safe", but as long as
references have problems, don't adopt this policy.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=8427&edit=1