Annotation of embedaddon/php/ext/reflection/tests/bug38217.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #38217 (ReflectionClass::newInstanceArgs() tries to allocate too much memory)
3: --FILE--
4: <?php
5:
6: class Object {
7: public function __construct() {
8: }
9: }
10:
11: $class= new ReflectionClass('Object');
12: var_dump($class->newInstanceArgs());
13:
14: class Object1 {
15: public function __construct($var) {
16: var_dump($var);
17: }
18: }
19:
20: $class= new ReflectionClass('Object1');
21: var_dump($class->newInstanceArgs());
22: var_dump($class->newInstanceArgs(array('test')));
23:
24:
25: echo "Done\n";
26: ?>
27: --EXPECTF--
28: object(Object)#%d (0) {
29: }
30:
31: Warning: Missing argument 1 for Object1::__construct() in %s on line %d
32:
33: Notice: Undefined variable: var in %s on line %d
34: NULL
35: object(Object1)#%d (0) {
36: }
37: string(4) "test"
38: object(Object1)#%d (0) {
39: }
40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>