note 117938 added to reflectionmethod.invokeargs
| From: | CodeCoutureXX at gmail dot com | Date: | Thu, 03 Sep 2015 21:12:19 +0000 |
| Subject: | note 117938 added to reflectionmethod.invokeargs | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203618@lists.php.net to get a copy of this message | ||
If you need to call ReflectionMethod::invokeArgs() on a static function you can pass NULL in for the
$object parameter.
Example:
<?php
class myClass {
public static myStaticFunc($a, $b) {
return $a + $b;
}
}
$ref = new ReflectionMethod('myClass', 'myStaticFunc');
echo $ref->invokeArgs(NULL, [12, 7]);
?>
produces the following output:
19
----
Server IP: 72.52.91.14
Probable Submitter: 96.244.246.213
----
Manual Page -- http://php.net/manual/en/reflectionmethod.invokeargs.php
Edit -- https://master.php.net/note/edit/117938
Del: integrated -- https://master.php.net/note/delete/117938/integrated
Del: useless -- https://master.php.net/note/delete/117938/useless
Del: bad code -- https://master.php.net/note/delete/117938/bad+code
Del: spam -- https://master.php.net/note/delete/117938/spam
Del: non-english -- https://master.php.net/note/delete/117938/non-english
Del: in docs -- https://master.php.net/note/delete/117938/in+docs
Del: other reasons-- https://master.php.net/note/delete/117938
Reject -- https://master.php.net/note/reject/117938
Search -- https://master.php.net/manage/user-notes.php