Annotation of embedaddon/php/ext/reflection/tests/bug52854.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #52854: ReflectionClass::newInstanceArgs does not work for classes without constructors
3: --FILE--
4: <?php
5: class Test {
6: }
7: $c = new ReflectionClass('Test');
8: var_dump(new Test);
9: var_dump(new Test());
10: var_dump($c->newInstance());
11: var_dump($c->newInstanceArgs(array()));
12:
13: try {
14: var_dump($c->newInstanceArgs(array(1)));
15: } catch(ReflectionException $e) {
16: echo $e->getMessage()."\n";
17: }
18: ?>
19: --EXPECTF--
20: object(Test)#%d (0) {
21: }
22: object(Test)#%d (0) {
23: }
24: object(Test)#%d (0) {
25: }
26: object(Test)#%d (0) {
27: }
28: Class Test does not have a constructor, so you cannot pass any constructor arguments
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>