note 102026 added to language.oop5.paamayim-nekudotayim
| From: | wes | Date: | Mon, 24 Jan 2011 02:52:21 +0000 |
| Subject: | note 102026 added to language.oop5.paamayim-nekudotayim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176233@lists.php.net to get a copy of this message | ||
Important to note that scope resolution operator can have unexpected effects on the meaning of $this
in a remote context.
<?php
// Tested in PHP 5.3.3
class Alpha {
function whoisbeta() {
return Beta::whoami();
}
}
class Beta {
function whoami() {
return get_class($this);
}
}
$a = new Alpha();
echo implode(', ', array(
Beta::whoami(), // Beta
Alpha::whoisbeta(), // Beta
$a->whoisbeta(), // Alpha (?!?!)
));
?>
----
Server IP: 69.147.83.197
Probable Submitter: 98.117.88.142
----
Manual Page -- http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
Edit -- https://master.php.net/note/edit/102026
Del: integrated -- https://master.php.net/note/delete/102026/integrated
Del: useless -- https://master.php.net/note/delete/102026/useless
Del: bad code -- https://master.php.net/note/delete/102026/bad+code
Del: spam -- https://master.php.net/note/delete/102026/spam
Del: non-english -- https://master.php.net/note/delete/102026/non-english
Del: in docs -- https://master.php.net/note/delete/102026/in+docs
Del: other reasons-- https://master.php.net/note/delete/102026
Reject -- https://master.php.net/note/reject/102026
Search -- https://master.php.net/manage/user-notes.php