/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/reflection/tests/ReflectionMethod_invoke_error2.phpt
29 строк
817 B
Davey Shafik
Implement \ArgumentCountError exception
31 авг 2016, 05:35
31 авг 2016, 05:35
12ee17d
Код
Авторство
О чём код?
--TEST-- ReflectionMethod::invoke() further errors --FILE-- <?php class TestClass { public function methodWithArgs($a, $b) { echo "Called methodWithArgs($a, $b)\n"; } } $methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs'); $testClassInstance = new TestClass(); echo "\nMethod with args:\n"; var_dump($methodWithArgs->invoke($testClassInstance)); ?> --EXPECTF-- Method with args: Fatal error: Uncaught ArgumentCountError: Too few arguments to function TestClass::methodWithArgs(), 0 passed and exactly 2 expected in %sReflectionMethod_invoke_error2.php:5 Stack trace: #0 [internal function]: TestClass->methodWithArgs() #1 %sReflectionMethod_invoke_error2.php(15): ReflectionMethod->invoke(Object(TestClass)) #2 {main} thrown in %sReflectionMethod_invoke_error2.php on line 5