note 104991 added to reflectionmethod.invoke
| From: | templargrey at wp dot pl | Date: | Thu, 21 Jul 2011 08:12:06 +0000 |
| Subject: | note 104991 added to reflectionmethod.invoke | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-181731@lists.php.net to get a copy of this message | ||
Seems that Reflection doesn`t resolve late static bindings - var_dump will show "string
'a' (length=1)".
<pre>
class ParentClass { protected static $a = 'a'; static public function init() { return
static::$a; } }
class ChildClass extends ParentClass { protected static $a = 'b'; }
$r = new ReflectionClass('ChildClass');
var_dump($r->getMethod('init')->invoke(null));
</pre>
----
Server IP: 69.147.83.197
Probable Submitter: 62.29.248.132
----
Manual Page -- http://www.php.net/manual/en/reflectionmethod.invoke.php
Edit -- https://master.php.net/note/edit/104991
Del: integrated -- https://master.php.net/note/delete/104991/integrated
Del: useless -- https://master.php.net/note/delete/104991/useless
Del: bad code -- https://master.php.net/note/delete/104991/bad+code
Del: spam -- https://master.php.net/note/delete/104991/spam
Del: non-english -- https://master.php.net/note/delete/104991/non-english
Del: in docs -- https://master.php.net/note/delete/104991/in+docs
Del: other reasons-- https://master.php.net/note/delete/104991
Reject -- https://master.php.net/note/reject/104991
Search -- https://master.php.net/manage/user-notes.php