ID:               8427
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Analyzed
 Bug Type:         Feature/Change Request
 Operating System: Any
 PHP Version:      4.0.4
 New Comment:

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.


 


Previous Comments:
------------------------------------------------------------------------

[2000-12-26 13:31:46] [EMAIL PROTECTED]

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/?id=8427&edit=1

Reply via email to