note 124732 added to reflectionparameter.isarray

From: Date: Wed, 19 Feb 2020 08:45:56 +0000
Subject: note 124732 added to reflectionparameter.isarray
Groups: php.notes 
Request: Send a blank email to php-notes+get-214166@lists.php.net to get a copy of this message
Hi, this is simple example of how to use it. class Test { public function testArray(array $a) { // do something... return $a; } public function testString(string $a) { // do something... return $a; } } $reflection = new ReflectionClass('Test'); foreach($reflection->getMethods() as $methods){ foreach($methods->getParameters() as $param){ var_dump($param->isArray()); } } //bool(true) //bool(false) ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.195 (proxied: 94.26.9.230) ---- Manual Page -- http://php.net/manual/en/reflectionparameter.isarray.php Edit -- https://master.php.net/note/edit/124732 Del: integrated -- https://master.php.net/note/delete/124732/integrated Del: useless -- https://master.php.net/note/delete/124732/useless Del: bad code -- https://master.php.net/note/delete/124732/bad+code Del: spam -- https://master.php.net/note/delete/124732/spam Del: non-english -- https://master.php.net/note/delete/124732/non-english Del: in docs -- https://master.php.net/note/delete/124732/in+docs Del: other reasons-- https://master.php.net/note/delete/124732 Reject -- https://master.php.net/note/reject/124732 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214166) next »