diff options
author | Johannes Schlüter <johannes@php.net> | 2008-11-03 19:28:32 +0000 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2008-11-03 19:28:32 +0000 |
commit | 850f9567b8df31b5173f381b925af477f164a977 (patch) | |
tree | ccb3330f67a32cbf10d54824b63fbe40a3cabf86 /Zend/tests | |
parent | d4e4cebd6538f98284f5bdc81dae128c70f2a84c (diff) | |
download | php-git-850f9567b8df31b5173f381b925af477f164a977.tar.gz |
MFH: Use a better function name for closure related errors and debug_backtrace()
Diffstat (limited to 'Zend/tests')
-rw-r--r-- | Zend/tests/closure_027.phpt | 2 | ||||
-rw-r--r-- | Zend/tests/closure_032.phpt | 65 |
2 files changed, 66 insertions, 1 deletions
diff --git a/Zend/tests/closure_027.phpt b/Zend/tests/closure_027.phpt index 7787f729e5..f26e114045 100644 --- a/Zend/tests/closure_027.phpt +++ b/Zend/tests/closure_027.phpt @@ -25,7 +25,7 @@ NULL Notice: Undefined variable: y in %s on line %d -Warning: Missing argument 1 for (), called in %s on line %d and defined in %s on line %d +Warning: Missing argument 1 for {closure}(), called in %s on line %d and defined in %s on line %d NULL Catchable fatal error: Argument 1 passed to test() must be an instance of Closure, instance of stdClass given, called in %s on line %d and defined in %s on line %d diff --git a/Zend/tests/closure_032.phpt b/Zend/tests/closure_032.phpt new file mode 100644 index 0000000000..6072f0d8d1 --- /dev/null +++ b/Zend/tests/closure_032.phpt @@ -0,0 +1,65 @@ +--TEST-- +Closure 032: Testing Closure and debug_backtrace +--FILE-- +<?php + +function test(closure $a) { + $a(23); +} + + +$c = function($param) { print_r(debug_backtrace()); debug_print_backtrace(); }; + +$c(23); +test($c); +?> +--EXPECTF-- +Array +( + [0] => Array + ( + [file] => %s + [line] => %d + [function] => {closure} + [args] => Array + ( + [0] => 23 + ) + + ) + +) +#0 {closure}(23) called at [%s:%d] +Array +( + [0] => Array + ( + [file] => %s + [line] => %d + [function] => {closure} + [args] => Array + ( + [0] => 23 + ) + + ) + + [1] => Array + ( + [file] => %s + [line] => %d + [function] => test + [args] => Array + ( + [0] => Closure Object + ( + ) + + ) + + ) + +) +#0 {closure}(23) called at [%s:%d] +#1 test(Closure Object ()) called at [%s:%d] + |