note 117350 added to reflectionparameter.isdefaultvalueconstant
| From: | kristianoye at gmail dot com | Date: | Mon, 25 May 2015 21:40:01 +0000 |
| Subject: | note 117350 added to reflectionparameter.isdefaultvalueconstant | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202667@lists.php.net to get a copy of this message | ||
This method returns true only if the parameter's default value is set to a named constant.
e.g.
class Foo {
const OPTION_MULTIGET = 1;
//Method 1
public function setGetOptions($opts=0);
//Method 2
public function setMultiGetOptions($opts=Foo::OPTION_MULTIGET);
}
Method 1's first ReflectionParameter will return isDefaultValueConstant() = false (0 is a
"constant"/static value but not a named constant) and Method 2's will return
isDefaultValueConsntant() = true.
----
Server IP: 72.52.91.14
Probable Submitter: 173.160.221.129
----
Manual Page -- http://php.net/manual/en/reflectionparameter.isdefaultvalueconstant.php
Edit -- https://master.php.net/note/edit/117350
Del: integrated -- https://master.php.net/note/delete/117350/integrated
Del: useless -- https://master.php.net/note/delete/117350/useless
Del: bad code -- https://master.php.net/note/delete/117350/bad+code
Del: spam -- https://master.php.net/note/delete/117350/spam
Del: non-english -- https://master.php.net/note/delete/117350/non-english
Del: in docs -- https://master.php.net/note/delete/117350/in+docs
Del: other reasons-- https://master.php.net/note/delete/117350
Reject -- https://master.php.net/note/reject/117350
Search -- https://master.php.net/manage/user-notes.php