note 85213 added to language.oop5.references
| From: | couchandatgmaildotcom at osu1 dot php dot net | Date: | Wed, 20 Aug 2008 17:50:40 +0000 |
| Subject: | note 85213 added to language.oop5.references | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143683@lists.php.net to get a copy of this message | ||
The above doesn't really make this clear, but the following:
<?php
class A {
public $foo = 1;
}
$a = new A;
$b = $a; // $a and $b are copies of the same identifier
// ($a) = ($b) = <id>
$c = &$a; // $c is a reference to $a
$c->foo = 2;
$a = NULL; // the object persists after the demise of $a
echo "a: ".$a->foo."\n";
echo "b: ".$b->foo."\n";
echo "c: ".$c->foo."\n";
?>
Outputs:
a:
b: 2
c:
----
Server IP: 64.71.164.2
Probable Submitter: 207.32.43.184
----
Manual Page -- http://www.php.net/manual/en/language.oop5.references.php
Edit -- https://master.php.net/note/edit/85213
Del: integrated -- https://master.php.net/note/delete/85213/integrated
Del: useless -- https://master.php.net/note/delete/85213/useless
Del: bad code -- https://master.php.net/note/delete/85213/bad+code
Del: spam -- https://master.php.net/note/delete/85213/spam
Del: non-english -- https://master.php.net/note/delete/85213/non-english
Del: in docs -- https://master.php.net/note/delete/85213/in+docs
Del: other reasons-- https://master.php.net/note/delete/85213
Reject -- https://master.php.net/note/reject/85213
Search -- https://master.php.net/manage/user-notes.php