diff options
Diffstat (limited to 'ext/standard/tests/general_functions/is_callable_anon.phpt')
| -rw-r--r-- | ext/standard/tests/general_functions/is_callable_anon.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/standard/tests/general_functions/is_callable_anon.phpt b/ext/standard/tests/general_functions/is_callable_anon.phpt new file mode 100644 index 0000000000..635f2a04ab --- /dev/null +++ b/ext/standard/tests/general_functions/is_callable_anon.phpt @@ -0,0 +1,22 @@ +--TEST-- +Test is_callable() function : usage variations - anonymous class method +--FILE-- +<?php + +new class { + function __construct() { + $fname = null; + if (is_callable([$this, 'f'], false, $fname)) { + call_user_func($fname); + } else { + echo "dang\n"; + } + } + function f() { + echo "nice\n"; + } +}; + +?> +--EXPECT-- +nice |
