note 102174 added to reflectionparameter.getclass
| From: | infernaz at gmail dot com | Date: | Mon, 31 Jan 2011 20:09:35 +0000 |
| Subject: | note 102174 added to reflectionparameter.getclass | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176544@lists.php.net to get a copy of this message | ||
The method returns ReflectionClass object of parameter type class or NULL if none.
<?php
class A {
function b(B $c, array $d, $e) {
}
}
class B {
}
$refl = new ReflectionClass('A');
$par = $refl->getMethod('b')->getParameters();
var_dump($par[0]->getClass()->getName()); // outputs B
var_dump($par[1]->getClass()); // note that array type outputs NULL
var_dump($par[2]->getClass()); // outputs NULL
?>
----
Server IP: 82.135.230.5
Probable Submitter: 78.57.140.244
----
Manual Page -- http://www.php.net/manual/en/reflectionparameter.getclass.php
Edit -- https://master.php.net/note/edit/102174
Del: integrated -- https://master.php.net/note/delete/102174/integrated
Del: useless -- https://master.php.net/note/delete/102174/useless
Del: bad code -- https://master.php.net/note/delete/102174/bad+code
Del: spam -- https://master.php.net/note/delete/102174/spam
Del: non-english -- https://master.php.net/note/delete/102174/non-english
Del: in docs -- https://master.php.net/note/delete/102174/in+docs
Del: other reasons-- https://master.php.net/note/delete/102174
Reject -- https://master.php.net/note/reject/102174
Search -- https://master.php.net/manage/user-notes.php