1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 13:01:02 +02:00
Files
archived-php-src/ext/reflection/tests/request38992.phpt
Máté Kocsis ac0853eb26 Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00

28 lines
646 B
PHP

--TEST--
Request #38992 (invoke() and invokeArgs() static method calls should match)
--FILE--
<?php
class MyClass
{
public static function doSomething()
{
echo "Did it!\n";
}
}
$r = new ReflectionMethod('MyClass', 'doSomething');
try {
$r->invoke('WTF?');
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
try {
$r->invokeArgs('WTF?', array());
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
ReflectionMethod::invoke() expects argument #1 ($object) to be of type object, string given
ReflectionMethod::invokeArgs() expects argument #1 ($object) to be of type object, string given