note 109052 added to language.oop5.references
| From: | kristofatviewrangerdotcom | Date: | Sat, 16 Jun 2012 14:07:09 +0000 |
| Subject: | note 109052 added to language.oop5.references | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188643@lists.php.net to get a copy of this message | ||
I hope this clarifies references a bit more:
<?php
class A {
public $foo = 1;
}
$a = new A;
$b = $a;
$a->foo = 2;
$a = NULL;
echo $b->foo."\n"; // 2
$c = new A;
$d = &$c;
$c->foo = 2;
$c = NULL;
echo $d->foo."\n"; // Notice: Trying to get property of non-object...
?>
----
Server IP: 69.147.83.197
Probable Submitter: 193.34.186.11
----
Manual Page -- http://www.php.net/manual/en/language.oop5.references.php
Edit -- https://master.php.net/note/edit/109052
Del: integrated -- https://master.php.net/note/delete/109052/integrated
Del: useless -- https://master.php.net/note/delete/109052/useless
Del: bad code -- https://master.php.net/note/delete/109052/bad+code
Del: spam -- https://master.php.net/note/delete/109052/spam
Del: non-english -- https://master.php.net/note/delete/109052/non-english
Del: in docs -- https://master.php.net/note/delete/109052/in+docs
Del: other reasons-- https://master.php.net/note/delete/109052
Reject -- https://master.php.net/note/reject/109052
Search -- https://master.php.net/manage/user-notes.php