diff options
Diffstat (limited to 'ext/reflection/tests')
29 files changed, 603 insertions, 700 deletions
diff --git a/ext/reflection/tests/002.phpt b/ext/reflection/tests/002.phpt index 833fed4aa5..cbd7319731 100644 --- a/ext/reflection/tests/002.phpt +++ b/ext/reflection/tests/002.phpt @@ -50,14 +50,14 @@ var_dump($r->bar); ===DONE=== --EXPECTF-- ReflectionMethodEx::__construct -%unicode|string%(26) "ReflectionFunctionAbstract" -%unicode|string%(7) "getName" -%unicode|string%(3) "xyz" +string(26) "ReflectionFunctionAbstract" +string(7) "getName" +string(3) "xyz" NULL Cannot set read-only property ReflectionMethodEx::$class Cannot set read-only property ReflectionMethodEx::$name -%unicode|string%(26) "ReflectionFunctionAbstract" -%unicode|string%(7) "getName" -%unicode|string%(3) "bar" -%unicode|string%(3) "baz" +string(26) "ReflectionFunctionAbstract" +string(7) "getName" +string(3) "bar" +string(3) "baz" ===DONE=== diff --git a/ext/reflection/tests/007.phpt b/ext/reflection/tests/007.phpt index d9204171b5..8dfc2e8bcc 100644 --- a/ext/reflection/tests/007.phpt +++ b/ext/reflection/tests/007.phpt @@ -53,10 +53,9 @@ function test($class) echo "\n"; } -function __autoload($class) -{ +spl_autoload_register(function ($class) { echo __FUNCTION__ . "($class)\n"; -} +}); test('Class_does_not_exist'); @@ -94,7 +93,7 @@ test('WithCtorWithArgs'); --EXPECTF-- ====>Class_does_not_exist -__autoload(Class_does_not_exist) +{closure}(Class_does_not_exist) string(41) "Class Class_does_not_exist does not exist" ====>NoCtor ====>newInstance() diff --git a/ext/reflection/tests/027.phpt b/ext/reflection/tests/027.phpt new file mode 100644 index 0000000000..06db60b8ec --- /dev/null +++ b/ext/reflection/tests/027.phpt @@ -0,0 +1,22 @@ +--TEST-- +ReflectionGenerator::getTrace() +--FILE-- +<?php +function foo() +{ + yield 1; +} + +$g = foo(); +$r = new ReflectionGenerator($g); + +$g->next(); + +try { + $r->getTrace(); +} catch (ReflectionException $e) { + echo $e->getMessage(); +} +?> +--EXPECTF-- +Cannot fetch information from a terminated Generator diff --git a/ext/reflection/tests/028.phpt b/ext/reflection/tests/028.phpt new file mode 100644 index 0000000000..5f1e7a2faa --- /dev/null +++ b/ext/reflection/tests/028.phpt @@ -0,0 +1,20 @@ +--TEST-- +ReflectionGenerator::__construct() +--FILE-- +<?php +function foo() +{ + yield 1; +} + +$g = foo(); +$g->next(); + +try { + $r = new ReflectionGenerator($g); +} catch (ReflectionException $e) { + echo "Done!\n"; +} +?> +--EXPECTF-- +Done! diff --git a/ext/reflection/tests/ReflectionClass_getMethod_001.phpt b/ext/reflection/tests/ReflectionClass_getMethod_001.phpt index 2f2d790f68..780b558cc7 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_001.phpt @@ -48,121 +48,121 @@ foreach($classes as $class) { --EXPECTF-- Reflecting on class pubf: --> Check for f(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "f" + ["class"]=> + string(4) "pubf" } --> Check for s(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "s" + ["class"]=> + string(4) "pubf" } --> Check for F(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "f" + ["class"]=> + string(4) "pubf" } --> Check for doesntExist(): Method doesntExist does not exist Reflecting on class subpubf: --> Check for f(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "f" + ["class"]=> + string(4) "pubf" } --> Check for s(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "s" + ["class"]=> + string(4) "pubf" } --> Check for F(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "f" + ["class"]=> + string(4) "pubf" } --> Check for doesntExist(): Method doesntExist does not exist Reflecting on class protf: --> Check for f(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "protf" } --> Check for s(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "protf" } --> Check for F(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "protf" } --> Check for doesntExist(): Method doesntExist does not exist Reflecting on class subprotf: --> Check for f(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "protf" } --> Check for s(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "protf" } --> Check for F(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "protf" } --> Check for doesntExist(): Method doesntExist does not exist Reflecting on class privf: --> Check for f(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "privf" } --> Check for s(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "privf" } --> Check for F(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "privf" } --> Check for doesntExist(): Method doesntExist does not exist Reflecting on class subprivf: --> Check for f(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "privf" } --> Check for s(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "privf" } --> Check for F(): object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "privf" } --> Check for doesntExist(): Method doesntExist does not exist diff --git a/ext/reflection/tests/ReflectionClass_getMethods_001.phpt b/ext/reflection/tests/ReflectionClass_getMethods_001.phpt index 1e11dee2f3..7d4b6774c2 100644 --- a/ext/reflection/tests/ReflectionClass_getMethods_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethods_001.phpt @@ -40,101 +40,101 @@ Reflecting on class pubf: array(2) { [0]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "f" + ["class"]=> + string(4) "pubf" } [1]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "s" + ["class"]=> + string(4) "pubf" } } Reflecting on class subpubf: array(2) { [0]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "f" + ["class"]=> + string(4) "pubf" } [1]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "s" + ["class"]=> + string(4) "pubf" } } Reflecting on class protf: array(2) { [0]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "protf" } [1]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "protf" } } Reflecting on class subprotf: array(2) { [0]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "protf" } [1]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "protf" } } Reflecting on class privf: array(2) { [0]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "privf" } [1]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "privf" } } Reflecting on class subprivf: array(2) { [0]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "f" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "f" + ["class"]=> + string(5) "privf" } [1]=> object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "privf" } } diff --git a/ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt b/ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt index 68189db2bb..f77bbacda7 100644 --- a/ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt +++ b/ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt @@ -31,7 +31,7 @@ dump_modifiers('g'); int(0) int(32) int(4) -int(64) -int(524288) -int(524352) +int(0) +int(0) +int(0) int(0) diff --git a/ext/reflection/tests/ReflectionClass_getProperties_001.phpt b/ext/reflection/tests/ReflectionClass_getProperties_001.phpt index cd4a29d450..ed0b160b93 100644 --- a/ext/reflection/tests/ReflectionClass_getProperties_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperties_001.phpt @@ -40,85 +40,85 @@ Reflecting on class pubf: array(2) { [0]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "a" + ["class"]=> + string(4) "pubf" } [1]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "s" + ["class"]=> + string(4) "pubf" } } Reflecting on class subpubf: array(2) { [0]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "a" + ["class"]=> + string(4) "pubf" } [1]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "s" + ["class"]=> + string(4) "pubf" } } Reflecting on class protf: array(2) { [0]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "a" + ["class"]=> + string(5) "protf" } [1]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "protf" } } Reflecting on class subprotf: array(2) { [0]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "a" + ["class"]=> + string(5) "protf" } [1]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "protf" } } Reflecting on class privf: array(2) { [0]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "a" + ["class"]=> + string(5) "privf" } [1]=> object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "privf" } } Reflecting on class subprivf: diff --git a/ext/reflection/tests/ReflectionClass_getProperty_001.phpt b/ext/reflection/tests/ReflectionClass_getProperty_001.phpt index 9e174b749e..fca68ed30f 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_001.phpt @@ -61,85 +61,85 @@ foreach($classes as $class) { --EXPECTF-- Reflecting on class pubf: --> Check for s: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "s" + ["class"]=> + string(4) "pubf" } --> Check for a: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "a" + ["class"]=> + string(4) "pubf" } --> Check for A: Property A does not exist --> Check for doesntExist: Property doesntExist does not exist Reflecting on class subpubf: --> Check for s: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "s" + ["class"]=> + string(4) "pubf" } --> Check for a: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(4) "pubf" + ["name"]=> + string(1) "a" + ["class"]=> + string(4) "pubf" } --> Check for A: Property A does not exist --> Check for doesntExist: Property doesntExist does not exist Reflecting on class protf: --> Check for s: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "protf" } --> Check for a: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "a" + ["class"]=> + string(5) "protf" } --> Check for A: Property A does not exist --> Check for doesntExist: Property doesntExist does not exist Reflecting on class subprotf: --> Check for s: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "protf" } --> Check for a: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(5) "protf" + ["name"]=> + string(1) "a" + ["class"]=> + string(5) "protf" } --> Check for A: Property A does not exist --> Check for doesntExist: Property doesntExist does not exist Reflecting on class privf: --> Check for s: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "privf" } --> Check for a: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "a" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "a" + ["class"]=> + string(5) "privf" } --> Check for A: Property A does not exist --> Check for doesntExist: Property doesntExist does not exist Reflecting on class subprivf: --> Check for s: object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(1) "s" - [%u|b%"class"]=> - %unicode|string%(5) "privf" + ["name"]=> + string(1) "s" + ["class"]=> + string(5) "privf" } --> Check for a: Property a does not exist --> Check for A: Property A does not exist diff --git a/ext/reflection/tests/ReflectionClass_getProperty_003.phpt b/ext/reflection/tests/ReflectionClass_getProperty_003.phpt index 515d9860ba..16c0c306ba 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_003.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_003.phpt @@ -97,146 +97,146 @@ showInfo("doesntexist::doesntExist"); --EXPECTF-- --- (Reflecting on pubA) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubA" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(4) "pubA" + ["class"]=> + string(1) "A" } -%unicode|string%(9) "pubA in A" +string(9) "pubA in A" --- (Reflecting on protA) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protA" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(5) "protA" + ["class"]=> + string(1) "A" } Cannot access non-public member C::protA --- (Reflecting on privA) --- Property privA does not exist --- (Reflecting on pubB) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubB" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(4) "pubB" + ["class"]=> + string(1) "B" } -%unicode|string%(9) "pubB in B" +string(9) "pubB in B" --- (Reflecting on protB) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protB" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(5) "protB" + ["class"]=> + string(1) "B" } Cannot access non-public member C::protB --- (Reflecting on privB) --- Property privB does not exist --- (Reflecting on pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "C" } -%unicode|string%(9) "pubC in C" +string(9) "pubC in C" --- (Reflecting on protC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(5) "protC" + ["class"]=> + string(1) "C" } Cannot access non-public member C::protC --- (Reflecting on privC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "privC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(5) "privC" + ["class"]=> + string(1) "C" } Cannot access non-public member C::privC --- (Reflecting on doesntExist) --- Property doesntExist does not exist --- (Reflecting on A::pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "A" } -%unicode|string%(9) "pubC in A" +string(9) "pubC in A" --- (Reflecting on A::protC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protC" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(5) "protC" + ["class"]=> + string(1) "A" } Cannot access non-public member A::protC --- (Reflecting on A::privC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "privC" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(5) "privC" + ["class"]=> + string(1) "A" } Cannot access non-public member A::privC --- (Reflecting on B::pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "B" } -%unicode|string%(9) "pubC in B" +string(9) "pubC in B" --- (Reflecting on B::protC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protC" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(5) "protC" + ["class"]=> + string(1) "B" } Cannot access non-public member B::protC --- (Reflecting on B::privC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "privC" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(5) "privC" + ["class"]=> + string(1) "B" } Cannot access non-public member B::privC --- (Reflecting on c::pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "C" } -%unicode|string%(9) "pubC in C" +string(9) "pubC in C" --- (Reflecting on c::PUBC) --- Property PUBC does not exist --- (Reflecting on C::pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "C" } -%unicode|string%(9) "pubC in C" +string(9) "pubC in C" --- (Reflecting on C::protC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(5) "protC" + ["class"]=> + string(1) "C" } Cannot access non-public member C::protC --- (Reflecting on C::privC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "privC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(5) "privC" + ["class"]=> + string(1) "C" } Cannot access non-public member C::privC --- (Reflecting on X::pubC) --- diff --git a/ext/reflection/tests/ReflectionClass_getProperty_004.phpt b/ext/reflection/tests/ReflectionClass_getProperty_004.phpt index 1070d57ce4..89335f42c4 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_004.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_004.phpt @@ -97,146 +97,146 @@ showInfo("doesntexist::doesntExist"); --EXPECTF-- --- (Reflecting on pubA) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubA" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(4) "pubA" + ["class"]=> + string(1) "A" } -%unicode|string%(9) "pubA in A" +string(9) "pubA in A" --- (Reflecting on protA) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protA" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(5) "protA" + ["class"]=> + string(1) "A" } Cannot access non-public member C::protA --- (Reflecting on privA) --- Property privA does not exist --- (Reflecting on pubB) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubB" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(4) "pubB" + ["class"]=> + string(1) "B" } -%unicode|string%(9) "pubB in B" +string(9) "pubB in B" --- (Reflecting on protB) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protB" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(5) "protB" + ["class"]=> + string(1) "B" } Cannot access non-public member C::protB --- (Reflecting on privB) --- Property privB does not exist --- (Reflecting on pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "C" } -%unicode|string%(9) "pubC in C" +string(9) "pubC in C" --- (Reflecting on protC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(5) "protC" + ["class"]=> + string(1) "C" } Cannot access non-public member C::protC --- (Reflecting on privC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "privC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(5) "privC" + ["class"]=> + string(1) "C" } Cannot access non-public member C::privC --- (Reflecting on doesntExist) --- Property doesntExist does not exist --- (Reflecting on A::pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "A" } -%unicode|string%(9) "pubC in C" +string(9) "pubC in C" --- (Reflecting on A::protC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protC" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(5) "protC" + ["class"]=> + string(1) "A" } Cannot access non-public member A::protC --- (Reflecting on A::privC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "privC" - [%u|b%"class"]=> - %unicode|string%(1) "A" + ["name"]=> + string(5) "privC" + ["class"]=> + string(1) "A" } Cannot access non-public member A::privC --- (Reflecting on B::pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "B" } -%unicode|string%(9) "pubC in C" +string(9) "pubC in C" --- (Reflecting on B::protC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protC" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(5) "protC" + ["class"]=> + string(1) "B" } Cannot access non-public member B::protC --- (Reflecting on B::privC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "privC" - [%u|b%"class"]=> - %unicode|string%(1) "B" + ["name"]=> + string(5) "privC" + ["class"]=> + string(1) "B" } Cannot access non-public member B::privC --- (Reflecting on c::pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "C" } -%unicode|string%(9) "pubC in C" +string(9) "pubC in C" --- (Reflecting on c::PUBC) --- Property PUBC does not exist --- (Reflecting on C::pubC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(4) "pubC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(4) "pubC" + ["class"]=> + string(1) "C" } -%unicode|string%(9) "pubC in C" +string(9) "pubC in C" --- (Reflecting on C::protC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "protC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(5) "protC" + ["class"]=> + string(1) "C" } Cannot access non-public member C::protC --- (Reflecting on C::privC) --- object(ReflectionProperty)#%d (2) { - [%u|b%"name"]=> - %unicode|string%(5) "privC" - [%u|b%"class"]=> - %unicode|string%(1) "C" + ["name"]=> + string(5) "privC" + ["class"]=> + string(1) "C" } Cannot access non-public member C::privC --- (Reflecting on X::pubC) --- diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt index ffd81ffb87..ab8afb8cb9 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt @@ -3,8 +3,6 @@ ReflectionClass::getStaticPropertyValue() --CREDITS-- Robin Fernandes <robinf@php.net> Steve Seear <stevseea@php.net> ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.4.0', '>=')) die('skip ZendEngine 2.3 or below needed'); ?> --FILE-- <?php class A { @@ -53,17 +51,9 @@ try { --EXPECTF-- Retrieving static values from A: string(13) "default value" -string(16) "original private" -string(13) "default value" -string(18) "original protected" -string(15) "original public" - -Retrieving static values from B: -string(16) "original private" -string(15) "changed private" -string(17) "changed protected" -string(14) "changed public" -Retrieving non-existent values from A with no default value: -Class A does not have a property named protectedOverridden -Class A does not have a property named privateOverridden +Fatal error: Uncaught ReflectionException: Class A does not have a property named in %s:%d +Stack trace: +#0 %s(%d): ReflectionClass->getStaticPropertyValue('\x00A\x00privateOverr...') +#1 {main} + thrown in %s on line %d diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt deleted file mode 100644 index 02f7595cb4..0000000000 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -ReflectionClass::getStaticPropertyValue() ---CREDITS-- -Robin Fernandes <robinf@php.net> -Steve Seear <stevseea@php.net> ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.4.0', '<')) die('skip ZendEngine 2.4 needed'); ?> ---FILE-- -<?php -class A { - static private $privateOverridden = "original private"; - static protected $protectedOverridden = "original protected"; - static public $publicOverridden = "original public"; -} - -class B extends A { - static private $privateOverridden = "changed private"; - static protected $protectedOverridden = "changed protected"; - static public $publicOverridden = "changed public"; -} - -echo "Retrieving static values from A:\n"; -$rcA = new ReflectionClass('A'); -var_dump($rcA->getStaticPropertyValue("privateOverridden", "default value")); -var_dump($rcA->getStaticPropertyValue("\0A\0privateOverridden")); -var_dump($rcA->getStaticPropertyValue("protectedOverridden", "default value")); -var_dump($rcA->getStaticPropertyValue("\0*\0protectedOverridden")); -var_dump($rcA->getStaticPropertyValue("publicOverridden")); - -echo "\nRetrieving static values from B:\n"; -$rcB = new ReflectionClass('B'); -var_dump($rcB->getStaticPropertyValue("\0A\0privateOverridden")); -var_dump($rcB->getStaticPropertyValue("\0B\0privateOverridden")); -var_dump($rcB->getStaticPropertyValue("\0*\0protectedOverridden")); -var_dump($rcB->getStaticPropertyValue("publicOverridden")); - -echo "\nRetrieving non-existent values from A with no default value:\n"; -try { - var_dump($rcA->getStaticPropertyValue("protectedOverridden")); - echo "you should not see this"; -} catch (Exception $e) { - echo $e->getMessage() . "\n"; -} - -try { - var_dump($rcA->getStaticPropertyValue("privateOverridden")); - echo "you should not see this"; -} catch (Exception $e) { - echo $e->getMessage() . "\n"; -} - -?> ---EXPECTF-- -Retrieving static values from A: -string(13) "default value" - -Fatal error: Uncaught ReflectionException: Class A does not have a property named in %sReflectionClass_getStaticPropertyValue_001_2_4.php:%d -Stack trace: -#0 %sReflectionClass_getStaticPropertyValue_001_2_4.php(%d): ReflectionClass->getStaticPropertyValue('\x00A\x00privateOverr...') -#1 {main} - thrown in %sReflectionClass_getStaticPropertyValue_001_2_4.php on line %d diff --git a/ext/reflection/tests/ReflectionClass_modifiers_001.phpt b/ext/reflection/tests/ReflectionClass_modifiers_001.phpt index 7f62b565a2..a1464a5ab9 100644 --- a/ext/reflection/tests/ReflectionClass_modifiers_001.phpt +++ b/ext/reflection/tests/ReflectionClass_modifiers_001.phpt @@ -41,4 +41,4 @@ int(4) bool(false) bool(true) bool(false) -int(64)
\ No newline at end of file +int(0) diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt index 9e8f01e679..0004f3ff5a 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt @@ -3,8 +3,6 @@ ReflectionClass::setStaticPropertyValue() --CREDITS-- Robin Fernandes <robinf@php.net> Steve Seear <stevseea@php.net> ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.4.0', '>=')) die('skip ZendEngine 2.3 or below needed'); ?> --FILE-- <?php class A { @@ -53,27 +51,9 @@ try { ?> --EXPECTF-- Set static values in A: -Array -( - [privateOverridden] => new value 1 - [protectedOverridden] => new value 2 - [publicOverridden] => new value 3 -) -Set static values in B: -Array -( - [privateOverridden] => new value 4 - [protectedOverridden] => new value 2 - [publicOverridden] => new value 3 -) -Array -( - [privateOverridden] => new value 5 - [protectedOverridden] => new value 6 - [publicOverridden] => new value 7 -) - -Set non-existent values from A with no default value: -Class A does not have a property named protectedOverridden -Class A does not have a property named privateOverridden +Fatal error: Uncaught ReflectionException: Class A does not have a property named in %s:%d +Stack trace: +#0 %s(%d): ReflectionClass->setStaticPropertyValue('\x00A\x00privateOverr...', 'new value 1') +#1 {main} + thrown in %s on line %d diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt deleted file mode 100644 index 6720d2daa2..0000000000 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -ReflectionClass::setStaticPropertyValue() ---CREDITS-- -Robin Fernandes <robinf@php.net> -Steve Seear <stevseea@php.net> ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.4.0', '<')) die('skip ZendEngine 2.4 needed'); ?> ---FILE-- -<?php -class A { - static private $privateOverridden = "original private"; - static protected $protectedOverridden = "original protected"; - static public $publicOverridden = "original public"; -} - -class B extends A { - static private $privateOverridden = "changed private"; - static protected $protectedOverridden = "changed protected"; - static public $publicOverridden = "changed public"; -} - -echo "Set static values in A:\n"; -$rcA = new ReflectionClass('A'); -$rcA->setStaticPropertyValue("\0A\0privateOverridden", "new value 1"); -$rcA->setStaticPropertyValue("\0*\0protectedOverridden", "new value 2"); -$rcA->setStaticPropertyValue("publicOverridden", "new value 3"); -print_r($rcA->getStaticProperties()); - -echo "\nSet static values in B:\n"; -$rcB = new ReflectionClass('B'); -$rcB->setStaticPropertyValue("\0A\0privateOverridden", "new value 4"); -$rcB->setStaticPropertyValue("\0B\0privateOverridden", "new value 5"); -$rcB->setStaticPropertyValue("\0*\0protectedOverridden", "new value 6"); -$rcB->setStaticPropertyValue("publicOverridden", "new value 7"); -print_r($rcA->getStaticProperties()); -print_r($rcB->getStaticProperties()); - -echo "\nSet non-existent values from A with no default value:\n"; -try { - var_dump($rcA->setStaticPropertyValue("protectedOverridden", "new value 8")); - echo "you should not see this"; -} catch (Exception $e) { - echo $e->getMessage() . "\n"; -} - -try { - var_dump($rcA->setStaticPropertyValue("privateOverridden", "new value 9")); - echo "you should not see this"; -} catch (Exception $e) { - echo $e->getMessage() . "\n"; -} - -?> ---EXPECTF-- -Set static values in A: - -Fatal error: Uncaught ReflectionException: Class A does not have a property named in %sReflectionClass_setStaticPropertyValue_001_2_4.php:%d -Stack trace: -#0 %sReflectionClass_setStaticPropertyValue_001_2_4.php(%d): ReflectionClass->setStaticPropertyValue('\x00A\x00privateOverr...', 'new value 1') -#1 {main} - thrown in %sReflectionClass_setStaticPropertyValue_001_2_4.php on line %d diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index 29d58420e3..5a2b497905 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -34,7 +34,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] { Property [ <default> public $name ] } - - Methods [52] { + - Methods [53] { Method [ <internal:Reflection> final private method __clone ] { - Parameters [0] { @@ -265,7 +265,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] { Method [ <internal:Reflection> public method newInstance ] { - Parameters [1] { - Parameter #0 [ <required> $args ] + Parameter #0 [ <optional> ...$args ] } } @@ -323,6 +323,12 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] { } } + Method [ <internal:Reflection> public method isIterable ] { + + - Parameters [0] { + } + } + Method [ <internal:Reflection> public method isIterateable ] { - Parameters [0] { diff --git a/ext/reflection/tests/ReflectionFunction_getClosureScopeClass.phpt b/ext/reflection/tests/ReflectionFunction_getClosureScopeClass.phpt index f725dfd088..e32790c923 100644 --- a/ext/reflection/tests/ReflectionFunction_getClosureScopeClass.phpt +++ b/ext/reflection/tests/ReflectionFunction_getClosureScopeClass.phpt @@ -2,9 +2,7 @@ Reflection::getClosureScopeClass() --SKIPIF-- <?php -if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50399) { - print 'skip'; -} +if (!extension_loaded('reflection')) print 'skip'; ?> --FILE-- <?php diff --git a/ext/reflection/tests/ReflectionFunction_getClosureThis.phpt b/ext/reflection/tests/ReflectionFunction_getClosureThis.phpt index 776bfafee0..4795025798 100644 --- a/ext/reflection/tests/ReflectionFunction_getClosureThis.phpt +++ b/ext/reflection/tests/ReflectionFunction_getClosureThis.phpt @@ -2,9 +2,7 @@ Reflection::getClosureThis() --SKIPIF-- <?php -if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) { - print 'skip'; -} +if (!extension_loaded('reflection')) print 'skip'; ?> --FILE-- <?php diff --git a/ext/reflection/tests/ReflectionFunction_isClosure_basic.phpt b/ext/reflection/tests/ReflectionFunction_isClosure_basic.phpt index 368464e130..df101fcd3e 100644 --- a/ext/reflection/tests/ReflectionFunction_isClosure_basic.phpt +++ b/ext/reflection/tests/ReflectionFunction_isClosure_basic.phpt @@ -5,9 +5,7 @@ Stefan Koopmanschap <stefan@phpgg.nl> TestFest PHP|Tek --SKIPIF-- <?php -if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) { - print 'skip'; -} +if (!extension_loaded('reflection')) print 'skip'; ?> --FILE-- <?php diff --git a/ext/reflection/tests/ReflectionMethod_getClosureThis.phpt b/ext/reflection/tests/ReflectionMethod_getClosureThis.phpt index 58c09994cf..536f40c2e1 100644 --- a/ext/reflection/tests/ReflectionMethod_getClosureThis.phpt +++ b/ext/reflection/tests/ReflectionMethod_getClosureThis.phpt @@ -2,9 +2,7 @@ Reflection::getClosureThis() --SKIPIF-- <?php -if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) { - print 'skip'; -} +if (!extension_loaded('reflection')) print 'skip'; ?> --FILE-- <?php diff --git a/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt b/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt index 72baa53fda..55aea10763 100644 --- a/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt @@ -87,156 +87,156 @@ printf("0x%08x\n", $a->getModifiers()); ?> --EXPECTF-- Modifiers for method TestClass::foo(): -0x08010100 +0x00000100 Modifiers for method TestClass::stat(): -0x08000101 +0x00000101 Modifiers for method TestClass::priv(): -0x08010400 +0x00000400 Modifiers for method TestClass::prot(): -0x08010200 +0x00000200 Modifiers for method TestClass::fin(): -0x08010104 +0x00000104 Modifiers for method TestClass::__destruct(): -0x08004100 +0x00000100 Modifiers for method TestClass::__call(): -0x08000100 +0x00000100 Modifiers for method TestClass::__clone(): -0x08008100 +0x00000100 Modifiers for method TestClass::__get(): -0x08000100 +0x00000100 Modifiers for method TestClass::__set(): -0x08000100 +0x00000100 Modifiers for method TestClass::__unset(): -0x08000100 +0x00000100 Modifiers for method TestClass::__isset(): -0x08000100 +0x00000100 Modifiers for method TestClass::__tostring(): -0x08000100 +0x00000100 Modifiers for method TestClass::__sleep(): -0x08010100 +0x00000100 Modifiers for method TestClass::__wakeup(): -0x08010100 +0x00000100 Modifiers for method TestClass::__set_state(): -0x08010100 +0x00000100 Modifiers for method TestClass::__autoload(): -0x08010100 +0x00000100 Modifiers for method TestClass::foo(): -0x08010100 +0x00000100 Modifiers for method TestClass::stat(): -0x08000101 +0x00000101 Modifiers for method TestClass::priv(): -0x08010400 +0x00000400 Modifiers for method TestClass::prot(): -0x08010200 +0x00000200 Modifiers for method TestClass::fin(): -0x08010104 +0x00000104 Modifiers for method TestClass::__destruct(): -0x08004100 +0x00000100 Modifiers for method TestClass::__call(): -0x08000100 +0x00000100 Modifiers for method TestClass::__clone(): -0x08008100 +0x00000100 Modifiers for method TestClass::__get(): -0x08000100 +0x00000100 Modifiers for method TestClass::__set(): -0x08000100 +0x00000100 Modifiers for method TestClass::__unset(): -0x08000100 +0x00000100 Modifiers for method TestClass::__isset(): -0x08000100 +0x00000100 Modifiers for method TestClass::__tostring(): -0x08000100 +0x00000100 Modifiers for method TestClass::__sleep(): -0x08010100 +0x00000100 Modifiers for method TestClass::__wakeup(): -0x08010100 +0x00000100 Modifiers for method TestClass::__set_state(): -0x08010100 +0x00000100 Modifiers for method TestClass::__autoload(): -0x08010100 +0x00000100 Modifiers for method TestInterface::int(): -0x08000102 +0x00000102 Modifiers for method TestInterface::__clone(): -0x08000102 +0x00000102 Modifiers for method AbstractClass::foo(): -0x08010102 +0x00000102 Wrong number of params: -Warning: ReflectionMethod::getModifiers() expects exactly 0 parameters, 1 given in %sReflectionMethod_getModifiers_basic.php on line %d +Warning: ReflectionMethod::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d ReflectionMethod::getModifiers() modifiers: 0x00000100 diff --git a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt index 5655d19972..942bea2dc2 100644 --- a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt +++ b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt @@ -1,76 +1,76 @@ ---TEST--
-ReflectionParameter class - canBePassedByValue() method.
---FILE--
-<?php
-
-function aux($fun) {
-
- $func = new ReflectionFunction($fun);
- $parameters = $func->getParameters();
- foreach($parameters as $parameter) {
- echo "Name: ", $parameter->getName(), "\n";
- echo "Is passed by reference: ", $parameter->isPassedByReference()?"yes":"no", "\n";
- echo "Can be passed by value: ", $parameter->canBePassedByValue()?"yes":"no", "\n";
- echo "\n";
- }
-
-}
-
-echo "=> array_multisort:\n\n";
-
-aux('array_multisort');
-
-
-echo "=> sort:\n\n";
-
-aux('sort');
-
-echo "=> user function:\n\n";
-
-function ufunc(&$arg1, $arg2) {}
-
-aux('ufunc');
-
-echo "Done.\n";
-
-?>
---EXPECTF--
-=> array_multisort:
-
-Name: arr1
-Is passed by reference: yes
-Can be passed by value: yes
-
-Name: sort_order
-Is passed by reference: yes
-Can be passed by value: yes
-
-Name: sort_flags
-Is passed by reference: yes
-Can be passed by value: yes
-
-Name: arr2
-Is passed by reference: yes
-Can be passed by value: yes
-
-=> sort:
-
-Name: arg
-Is passed by reference: yes
-Can be passed by value: no
-
-Name: sort_flags
-Is passed by reference: no
-Can be passed by value: yes
-
-=> user function:
-
-Name: arg1
-Is passed by reference: yes
-Can be passed by value: no
-
-Name: arg2
-Is passed by reference: no
-Can be passed by value: yes
-
-Done.
+--TEST-- +ReflectionParameter class - canBePassedByValue() method. +--FILE-- +<?php + +function aux($fun) { + + $func = new ReflectionFunction($fun); + $parameters = $func->getParameters(); + foreach($parameters as $parameter) { + echo "Name: ", $parameter->getName(), "\n"; + echo "Is passed by reference: ", $parameter->isPassedByReference()?"yes":"no", "\n"; + echo "Can be passed by value: ", $parameter->canBePassedByValue()?"yes":"no", "\n"; + echo "\n"; + } + +} + +echo "=> array_multisort:\n\n"; + +aux('array_multisort'); + + +echo "=> sort:\n\n"; + +aux('sort'); + +echo "=> user function:\n\n"; + +function ufunc(&$arg1, $arg2) {} + +aux('ufunc'); + +echo "Done.\n"; + +?> +--EXPECTF-- +=> array_multisort: + +Name: arr1 +Is passed by reference: yes +Can be passed by value: yes + +Name: sort_order +Is passed by reference: yes +Can be passed by value: yes + +Name: sort_flags +Is passed by reference: yes +Can be passed by value: yes + +Name: arr2 +Is passed by reference: yes +Can be passed by value: yes + +=> sort: + +Name: arg +Is passed by reference: yes +Can be passed by value: no + +Name: sort_flags +Is passed by reference: no +Can be passed by value: yes + +=> user function: + +Name: arg1 +Is passed by reference: yes +Can be passed by value: no + +Name: arg2 +Is passed by reference: no +Can be passed by value: yes + +Done. diff --git a/ext/reflection/tests/ReflectionParameter_isDefault.phpt b/ext/reflection/tests/ReflectionParameter_isDefault.phpt index 657077093b..d8b4f0edc0 100644 --- a/ext/reflection/tests/ReflectionParameter_isDefault.phpt +++ b/ext/reflection/tests/ReflectionParameter_isDefault.phpt @@ -1,34 +1,34 @@ ---TEST--
-ReflectionParameter::isDefault()
---FILE--
-<?php
-class A {
-public $defprop;
-}
-$a = new A;
-$a->myprop = null;
-
-$ro = new ReflectionObject($a);
-$props = $ro->getProperties();
-$prop1 = $props[0];
-var_dump($prop1->isDefault());
-$prop2 = $props[1];
-var_dump($prop2->isDefault());
-
-var_dump($ro->getProperty('defprop')->isDefault());
-var_dump($ro->getProperty('myprop')->isDefault());
-
-$prop1 = new ReflectionProperty($a, 'defprop');
-$prop2 = new ReflectionProperty($a, 'myprop');
-var_dump($prop1->isDefault());
-var_dump($prop2->isDefault());
-?>
-==DONE==
---EXPECT--
-bool(true)
-bool(false)
-bool(true)
-bool(false)
-bool(true)
-bool(false)
-==DONE==
+--TEST-- +ReflectionParameter::isDefault() +--FILE-- +<?php +class A { +public $defprop; +} +$a = new A; +$a->myprop = null; + +$ro = new ReflectionObject($a); +$props = $ro->getProperties(); +$prop1 = $props[0]; +var_dump($prop1->isDefault()); +$prop2 = $props[1]; +var_dump($prop2->isDefault()); + +var_dump($ro->getProperty('defprop')->isDefault()); +var_dump($ro->getProperty('myprop')->isDefault()); + +$prop1 = new ReflectionProperty($a, 'defprop'); +$prop2 = new ReflectionProperty($a, 'myprop'); +var_dump($prop1->isDefault()); +var_dump($prop2->isDefault()); +?> +==DONE== +--EXPECT-- +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +==DONE== diff --git a/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt b/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt index 0d1b6bd13a..38137551fc 100644 --- a/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt +++ b/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt @@ -37,10 +37,10 @@ D::a1: int(256) C::a2: int(512) D::a2: int(512) C::a3: int(1024) -D::a3: int(3072) +D::a3: int(1024) C::a4: int(257) D::a4: int(257) C::a5: int(513) D::a5: int(513) C::a6: int(1025) -D::a6: int(3073) +D::a6: int(1025) diff --git a/ext/reflection/tests/bug26640.phpt b/ext/reflection/tests/bug26640.phpt index e375fd4f89..8a93d72247 100644 --- a/ext/reflection/tests/bug26640.phpt +++ b/ext/reflection/tests/bug26640.phpt @@ -3,8 +3,7 @@ Reflection Bug #26640 (__autoload() not invoked by Reflection classes) --FILE-- <?php -function __autoload($c) -{ +spl_autoload_register(function ($c) { class autoload_class { public function __construct() @@ -12,7 +11,7 @@ function __autoload($c) print "autoload success\n"; } } -} +}); $a = new ReflectionClass('autoload_class'); diff --git a/ext/reflection/tests/bug29268.phpt b/ext/reflection/tests/bug29268.phpt index d8efc0b06e..0ab7e332b2 100644 --- a/ext/reflection/tests/bug29268.phpt +++ b/ext/reflection/tests/bug29268.phpt @@ -2,10 +2,10 @@ Reflection Bug #29268 (__autoload() not called with reflectionProperty->getClass()) --FILE-- <?php -function __autoload($classname) { +spl_autoload_register(function ($classname) { echo "__autoload($classname)\n"; eval("class $classname {}"); -} +}); class B{ public function doit(A $a){ diff --git a/ext/reflection/tests/bug61388.phpt b/ext/reflection/tests/bug61388.phpt index 75c0300151..3d6dc83fa0 100644 --- a/ext/reflection/tests/bug61388.phpt +++ b/ext/reflection/tests/bug61388.phpt @@ -25,6 +25,12 @@ Array ( [0] => ReflectionProperty Object ( + [name] => 0 + [class] => stdClass + ) + + [1] => ReflectionProperty Object + ( [name] => oo [class] => stdClass ) diff --git a/ext/reflection/tests/bug74035.phpt b/ext/reflection/tests/bug74035.phpt new file mode 100644 index 0000000000..74cf03f5e5 --- /dev/null +++ b/ext/reflection/tests/bug74035.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #74035: getNumberOfRequiredParameters wrong for ReflectionClass::newInstance +--FILE-- +<?php +$r = new ReflectionClass(ReflectionClass::class); +$m = $r->getMethod('newInstance'); + +echo $m->getNumberOfRequiredParameters(); +?> +--EXPECT-- +0 |