note 39588 added to language.references

From: Date: Tue, 03 Feb 2004 15:30:07 +0000
Subject: note 39588 added to language.references
Groups: php.notes 
Request: Send a blank email to php-notes+get-64599@lists.php.net to get a copy of this message
Since references are more like hardlinks than pointers, it is not possible to change a reference to an object by using that same reference. For example: The following WILL NOT WORK as expected and may even crash the PHP interpreter: $object =& $object->getNext(); However, by changing the previous statement to use a temporary reference, this WILL WORK: $temp =& $object; $object =& $temp->getNext(); ---- Manual Page -- http://www.php.net/manual/en/language.references.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39588 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39588&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39588&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64599) next »