|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-12-27 07:46 UTC] cox@php.net
[2001-12-27 16:21 UTC] jfrisby at mrjoy dot com
[2001-12-27 19:53 UTC] ssb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 10:00:02 2025 UTC |
$foo =& new SomePEARDervidedClassWithADestructor(); $foo = null; In the above case, the destructor is never called. Presumably, the assignment is being interpreted as requesting that the object instance be nullified, rather than the more intuitive (IMNSHO) notion of nullifying the reference to the object. If you change the null-assignment line above to be: function &nullref() { return null; } $foo =& nullref(); The desired semantics are preserved. Of course, the following is presently invalid: $foo =& null; May I suggest that the above be added to allow the desired semantics in a simple fashion? Or at the very least, document this rather unexpected behavior?