summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug52854.phpt
blob: 2d174bc11eba7933db837d24294143543c215f96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--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