diff options
Diffstat (limited to 'ext/reflection/tests/ReflectionClass_getName_basic.phpt')
-rw-r--r-- | ext/reflection/tests/ReflectionClass_getName_basic.phpt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/reflection/tests/ReflectionClass_getName_basic.phpt b/ext/reflection/tests/ReflectionClass_getName_basic.phpt new file mode 100644 index 0000000000..158413f158 --- /dev/null +++ b/ext/reflection/tests/ReflectionClass_getName_basic.phpt @@ -0,0 +1,25 @@ +--TEST-- +ReflectionClass::getName() +--FILE-- +<?php +class TrickClass { + function __toString() { + //Return the name of another class + return "Exception"; + } +} + +$r1 = new ReflectionClass("stdClass"); + +$myInstance = new stdClass; +$r2 = new ReflectionClass($myInstance); + +$r3 = new ReflectionClass("TrickClass"); + +var_dump($r1->getName(), $r2->getName(), $r3->getName()); + +?> +--EXPECTF-- +string(8) "stdClass" +string(8) "stdClass" +string(10) "TrickClass" |