diff options
Diffstat (limited to 'Zend/tests/methods-on-non-objects-call-user-func.phpt')
-rw-r--r-- | Zend/tests/methods-on-non-objects-call-user-func.phpt | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Zend/tests/methods-on-non-objects-call-user-func.phpt b/Zend/tests/methods-on-non-objects-call-user-func.phpt index 027aa64c20..63884abc79 100644 --- a/Zend/tests/methods-on-non-objects-call-user-func.phpt +++ b/Zend/tests/methods-on-non-objects-call-user-func.phpt @@ -2,11 +2,12 @@ call_user_func() in combination with "Call to a member function method() on a non-object" --FILE-- <?php -$comparator= null; -var_dump(call_user_func([$comparator, 'compare'], 1, 2)); -echo "Alive\n"; +$comparator = null; +try { + var_dump(call_user_func([$comparator, 'compare'], 1, 2)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d -NULL -Alive +--EXPECT-- +call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object |