Edit report at http://bugs.php.net/bug.php?id=8427&edit=1

 ID:                 8427
 Updated by:         [email protected]
 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] [email protected]

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

Reply via email to