mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
32 lines
805 B
PHP
32 lines
805 B
PHP
--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";
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Method ReflectionFunction::__invoke() does not exist
|
|
The parameter class is expected to be either a string, an array(class, method) or a callable object
|