note 99486 added to language.oop5.paamayim-nekudotayim
| From: | phil at philfreo dot com | Date: | Thu, 19 Aug 2010 17:00:21 +0000 |
| Subject: | note 99486 added to language.oop5.paamayim-nekudotayim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171862@lists.php.net to get a copy of this message | ||
I'm not sure if this was intentional or not, but it's worth noting...
As of PHP5.3 you can can say:
<?php
class Foo {
public function __construct($logClass = 'MyLog') {
$logClass::write();
}
}
?>
But you CANNOT say:
<?php
class Foo {
protected $log;
public function __construct($logClass = 'MyLog') {
$this->log = $logClass;
$this->log::write(); // breaks
}
}
?>
NOR can you say:
<?php
class Foo {
protected static $log;
public function __construct($logClass = 'MyLog') {
self::$log = $logClass;
self::$log::write(); // breaks
}
}
?>
----
Server IP: 89.31.146.176
Probable Submitter: 75.36.179.28
----
Manual Page -- http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
Edit -- https://master.php.net/note/edit/99486
Del: integrated -- https://master.php.net/note/delete/99486/integrated
Del: useless -- https://master.php.net/note/delete/99486/useless
Del: bad code -- https://master.php.net/note/delete/99486/bad+code
Del: spam -- https://master.php.net/note/delete/99486/spam
Del: non-english -- https://master.php.net/note/delete/99486/non-english
Del: in docs -- https://master.php.net/note/delete/99486/in+docs
Del: other reasons-- https://master.php.net/note/delete/99486
Reject -- https://master.php.net/note/reject/99486
Search -- https://master.php.net/manage/user-notes.php