summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionClass_newInstanceArgs_002.phpt
blob: bd27dfc17361b4c2052ade832f6d0289d848b986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
ReflectionClass::newInstanceArgs() - wrong arg type
--CREDITS--
Robin Fernandes <robinf@php.net>
Steve Seear <stevseea@php.net>
--FILE--
<?php
class A {
	public function __construct($a, $b) {
		echo "In constructor of class B with arg $a\n";
	}
}
$rc = new ReflectionClass('A');
$a = $rc->newInstanceArgs('x');
var_dump($a);

?>
--EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to ReflectionClass::newInstanceArgs() must be of the type array, string given in %s:8
Stack trace:
#0 %s(%d): ReflectionClass->newInstanceArgs('x')
#1 {main}
  thrown in %s on line 8