php-src/Zend/tests/closure_032.phpt
Nikita Popov de6e401e05
Use common formatting for backtraces (#6977)
This makes debug_print_backtrace() use the same formatting as exception
backtraces. The only difference is that the final #{main} is omitted,
because it wouldn't make sense for limited backtraces, and wasn't there
previously either.
2021-05-18 11:43:37 +02:00

70 lines
1.2 KiB
PHP

--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 %s(%d): {closure}(23)
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
(
[parameter] => Array
(
[$param] => <required>
)
)
)
)
)
#0 %s(%d): {closure}(23)
#1 %s(%d): test(Object(Closure))