php-src/ext/reflection/tests/ReflectionClass_getName_basic.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

25 lines
451 B
PHP

--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());
?>
--EXPECT--
string(8) "stdClass"
string(8) "stdClass"
string(10) "TrickClass"