summaryrefslogtreecommitdiff
path: root/Zend/tests/call_user_func_001.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/call_user_func_001.phpt')
-rw-r--r--Zend/tests/call_user_func_001.phpt35
1 files changed, 35 insertions, 0 deletions
diff --git a/Zend/tests/call_user_func_001.phpt b/Zend/tests/call_user_func_001.phpt
new file mode 100644
index 000000000..e9b35f957
--- /dev/null
+++ b/Zend/tests/call_user_func_001.phpt
@@ -0,0 +1,35 @@
+--TEST--
+Testing call_user_func inside namespace
+--FILE--
+<?php
+
+namespace testing {
+ function foobar($str) {
+ var_dump($str);
+ }
+
+ abstract class bar {
+ protected function prot($str) {
+ print "Shouldn't be called!\n";
+ }
+ }
+ class foo extends bar {
+ private function priv($str) {
+ print "Shouldn't be called!\n";
+ }
+ }
+
+ call_user_func(__NAMESPACE__ .'\foobar', 'foobar');
+
+ $class = __NAMESPACE__ .'\foo';
+ call_user_func(array(new $class, 'priv'), 'foobar');
+ call_user_func(array(new $class, 'prot'), 'foobar');
+}
+
+?>
+--EXPECTF--
+%string|unicode%(6) "foobar"
+
+Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access private method testing\foo::priv() in %s on line %d
+
+Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access protected method testing\foo::prot() in %s on line %d