diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-02-10 15:43:23 +0100 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-02-10 15:47:17 +0100 |
commit | 830d3d79b3744db021f2183857c5a625e96c6315 (patch) | |
tree | 91c21b780a676263c030193003096ffd9e9bbff6 /ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt | |
parent | 6c9d75b44d559f9d35fba01b1f6eb16aef4c23b1 (diff) | |
download | php-git-830d3d79b3744db021f2183857c5a625e96c6315.tar.gz |
Revert "Revert "Improve and generalize class constant substitution""
This reverts commit 400e65e955f08ad6ae57c1a15be04d5852107252.
Removing ReflectionParameter::getDefaultValueConstantName() and isDefaultValueConstant()
They become useless with such optimizations and already anyway are (e.g. CONSTANT?:CONSTANT ... yields the constant back without telling isDefaultValueConstant() about it etc.)
Diffstat (limited to 'ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt')
-rw-r--r-- | ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt deleted file mode 100644 index cdd00d2624..0000000000 --- a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() ---FILE-- -<?php - -define("CONST_TEST_1", "const1"); - -function ReflectionParameterTest($test1=array(), $test2 = CONST_TEST_1) { - echo $test; -} -$reflect = new ReflectionFunction('ReflectionParameterTest'); -foreach($reflect->getParameters() as $param) { - if($param->getName() == 'test1') { - var_dump($param->isDefaultValueConstant()); - } - if($param->getName() == 'test2') { - var_dump($param->isDefaultValueConstant()); - } - if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) { - var_dump($param->getDefaultValueConstantName()); - } -} - -class Foo2 { - const bar = 'Foo2::bar'; -} - -class Foo { - const bar = 'Foo::bar'; - - public function baz($param1 = self::bar, $param2=Foo2::bar, $param3=CONST_TEST_1) { - } -} - -$method = new ReflectionMethod('Foo', 'baz'); -$params = $method->getParameters(); - -foreach ($params as $param) { - if ($param->isDefaultValueConstant()) { - var_dump($param->getDefaultValueConstantName()); - } -} -?> -==DONE== ---EXPECT-- -bool(false) -bool(true) -string(12) "CONST_TEST_1" -string(9) "self::bar" -string(9) "Foo2::bar" -string(12) "CONST_TEST_1" -==DONE== |