note 86561 added to language.oop5.basic
| From: | webmasteratonnildotcom at osu1 dot php dot net | Date: | Thu, 23 Oct 2008 20:12:09 +0000 |
| Subject: | note 86561 added to language.oop5.basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145668@lists.php.net to get a copy of this message | ||
Example #6 Object Assignment
<?php
$assigned = $instance;
$reference =& $instance;
$instance->var = '$assigned will have this value';
$instance = null; // $instance and $reference become null
var_dump($instance);
var_dump($reference);
var_dump($assigned);
?>
Mistake in the documentation The above example will output (PHP5):
NULL
NULL
NULL
BUT NOT (from documentation):
NULL
NULL
object(SimpleClass)#1 (1) {
["var"]=>
string(30) "$assigned will have this value"
}
Example of output (from documentation) could be possible in case using PHP4.
----
Server IP: 69.147.83.197
Probable Submitter: 92.112.99.149
----
Manual Page -- http://www.php.net/manual/en/language.oop5.basic.php
Edit -- https://master.php.net/note/edit/86561
Del: integrated -- https://master.php.net/note/delete/86561/integrated
Del: useless -- https://master.php.net/note/delete/86561/useless
Del: bad code -- https://master.php.net/note/delete/86561/bad+code
Del: spam -- https://master.php.net/note/delete/86561/spam
Del: non-english -- https://master.php.net/note/delete/86561/non-english
Del: in docs -- https://master.php.net/note/delete/86561/in+docs
Del: other reasons-- https://master.php.net/note/delete/86561
Reject -- https://master.php.net/note/reject/86561
Search -- https://master.php.net/manage/user-notes.php