summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionParameter_export_error2.phpt
blob: aa0bc0aa7cc582f26cbc2718ace4bd5580ff80f1 (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
29
30
31
--TEST--
ReflectionParameter::export() with incorrect first parameter
--CREDITS--
Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
--FILE--
<?php
function ReflectionParameterTest($test, $test2 = null) {
	echo $test;
}
$reflect = new ReflectionFunction('ReflectionParameterTest');
$params = $reflect->getParameters();
try {
	foreach($params as $key => $value) {
		ReflectionParameter::export($reflect, $key);
	}
}
catch (ReflectionException $e) {
	echo $e->getMessage() . "\n";
}
try {
	foreach($params as $key => $value) {
		ReflectionParameter::export(42, $key);
	}
}
catch (ReflectionException $e) {
	echo $e->getMessage() . "\n";
}
?>
--EXPECT--
Method ReflectionFunction::__invoke() does not exist
The parameter class is expected to be either a string, an array(class, method) or a callable object