php-src/ext/reflection/tests/bug52854.phpt
Johannes Schlüter ac4f3422bc - Improve test
2010-11-21 12:28:10 +00:00

29 lines
586 B
PHP

--TEST--
Bug #52854: ReflectionClass::newInstanceArgs does not work for classes without constructors
--FILE--
<?php
class Test {
}
$c = new ReflectionClass('Test');
var_dump(new Test);
var_dump(new Test());
var_dump($c->newInstance());
var_dump($c->newInstanceArgs(array()));
try {
var_dump($c->newInstanceArgs(array(1)));
} catch(ReflectionException $e) {
echo $e->getMessage()."\n";
}
?>
--EXPECTF--
object(Test)#%d (0) {
}
object(Test)#%d (0) {
}
object(Test)#%d (0) {
}
object(Test)#%d (0) {
}
Class Test does not have a constructor, so you cannot pass any constructor arguments