summaryrefslogtreecommitdiff
path: root/Zend/tests/call_user_func_002.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/call_user_func_002.phpt')
-rw-r--r--Zend/tests/call_user_func_002.phpt42
1 files changed, 27 insertions, 15 deletions
diff --git a/Zend/tests/call_user_func_002.phpt b/Zend/tests/call_user_func_002.phpt
index 454c6fda96..cc07ffab16 100644
--- a/Zend/tests/call_user_func_002.phpt
+++ b/Zend/tests/call_user_func_002.phpt
@@ -4,26 +4,38 @@ Testing call_user_func() with autoload and passing invalid params
<?php
spl_autoload_register(function ($class) {
- var_dump($class);
+ var_dump($class);
});
-call_user_func(array('foo', 'bar'));
-call_user_func(array('', 'bar'));
-call_user_func(array($foo, 'bar'));
-call_user_func(array($foo, ''));
+try {
+ call_user_func(array('foo', 'bar'));
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ call_user_func(array('', 'bar'));
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ call_user_func(array($foo, 'bar'));
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ call_user_func(array($foo, ''));
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
?>
--EXPECTF--
string(3) "foo"
+call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found
+call_user_func() expects parameter 1 to be a valid callback, class '' not found
-Warning: call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found in %s on line %d
+Warning: Undefined variable: foo in %s on line %d
+call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object
-Warning: call_user_func() expects parameter 1 to be a valid callback, class '' not found in %s on line %d
-
-Notice: Undefined variable: foo in %s on line %d
-
-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
-
-Notice: Undefined variable: foo in %s on line %d
-
-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
+Warning: Undefined variable: foo in %s on line %d
+call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object