123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397 |
- --TEST--
- debug_backtrace options
- --FILE--
- <?php
- function backtrace_print($opt = null)
- {
- if(is_null($opt)) {
- print_r(debug_backtrace());
- } else {
- print_r(debug_backtrace($opt));
- }
- }
- function doit($a, $b, $how)
- {
- echo "==default\n";
- $how();
- echo "==true\n";
- $how(true);
- echo "==false\n";
- $how(false);
- echo "==DEBUG_BACKTRACE_PROVIDE_OBJECT\n";
- $how(DEBUG_BACKTRACE_PROVIDE_OBJECT);
- echo "==DEBUG_BACKTRACE_IGNORE_ARGS\n";
- $how(DEBUG_BACKTRACE_IGNORE_ARGS);
- echo "==both\n";
- $how(DEBUG_BACKTRACE_PROVIDE_OBJECT|DEBUG_BACKTRACE_IGNORE_ARGS);
- }
- class foo {
- protected function doCall($dowhat, $how)
- {
- $dowhat('a','b', $how);
- }
- static function statCall($dowhat, $how)
- {
- $obj = new self();
- $obj->doCall($dowhat, $how);
- }
- }
- foo::statCall("doit", "debug_print_backtrace");
- foo::statCall("doit", "backtrace_print");
- ?>
- --EXPECTF--
- ==default
- #0 %sdebug_backtrace_options.php(%d): doit('a', 'b', 'debug_print_bac...')
- #1 %sdebug_backtrace_options.php(%d): foo->doCall('doit', 'debug_print_bac...')
- #2 %sdebug_backtrace_options.php(%d): foo::statCall('doit', 'debug_print_bac...')
- ==true
- #0 %sdebug_backtrace_options.php(%d): doit('a', 'b', 'debug_print_bac...')
- #1 %sdebug_backtrace_options.php(%d): foo->doCall('doit', 'debug_print_bac...')
- #2 %sdebug_backtrace_options.php(%d): foo::statCall('doit', 'debug_print_bac...')
- ==false
- #0 %sdebug_backtrace_options.php(%d): doit('a', 'b', 'debug_print_bac...')
- #1 %sdebug_backtrace_options.php(%d): foo->doCall('doit', 'debug_print_bac...')
- #2 %sdebug_backtrace_options.php(%d): foo::statCall('doit', 'debug_print_bac...')
- ==DEBUG_BACKTRACE_PROVIDE_OBJECT
- #0 %sdebug_backtrace_options.php(%d): doit('a', 'b', 'debug_print_bac...')
- #1 %sdebug_backtrace_options.php(%d): foo->doCall('doit', 'debug_print_bac...')
- #2 %sdebug_backtrace_options.php(%d): foo::statCall('doit', 'debug_print_bac...')
- ==DEBUG_BACKTRACE_IGNORE_ARGS
- #0 %sdebug_backtrace_options.php(%d): doit()
- #1 %sdebug_backtrace_options.php(%d): foo->doCall()
- #2 %sdebug_backtrace_options.php(%d): foo::statCall()
- ==both
- #0 %sdebug_backtrace_options.php(%d): doit()
- #1 %sdebug_backtrace_options.php(%d): foo->doCall()
- #2 %sdebug_backtrace_options.php(%d): foo::statCall()
- ==default
- Array
- (
- [0] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => backtrace_print
- [args] => Array
- (
- )
- )
- [1] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doit
- [args] => Array
- (
- [0] => a
- [1] => b
- [2] => backtrace_print
- )
- )
- [2] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doCall
- [class] => foo
- [object] => foo Object
- (
- )
- [type] => ->
- [args] => Array
- (
- [0] => doit
- [1] => backtrace_print
- )
- )
- [3] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => statCall
- [class] => foo
- [type] => ::
- [args] => Array
- (
- [0] => doit
- [1] => backtrace_print
- )
- )
- )
- ==true
- Array
- (
- [0] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => 17
- [function] => backtrace_print
- [args] => Array
- (
- [0] => 1
- )
- )
- [1] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doit
- [args] => Array
- (
- [0] => a
- [1] => b
- [2] => backtrace_print
- )
- )
- [2] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doCall
- [class] => foo
- [object] => foo Object
- (
- )
- [type] => ->
- [args] => Array
- (
- [0] => doit
- [1] => backtrace_print
- )
- )
- [3] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => statCall
- [class] => foo
- [type] => ::
- [args] => Array
- (
- [0] => doit
- [1] => backtrace_print
- )
- )
- )
- ==false
- Array
- (
- [0] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => 19
- [function] => backtrace_print
- [args] => Array
- (
- [0] =>
- )
- )
- [1] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doit
- [args] => Array
- (
- [0] => a
- [1] => b
- [2] => backtrace_print
- )
- )
- [2] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doCall
- [class] => foo
- [type] => ->
- [args] => Array
- (
- [0] => doit
- [1] => backtrace_print
- )
- )
- [3] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => statCall
- [class] => foo
- [type] => ::
- [args] => Array
- (
- [0] => doit
- [1] => backtrace_print
- )
- )
- )
- ==DEBUG_BACKTRACE_PROVIDE_OBJECT
- Array
- (
- [0] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => 21
- [function] => backtrace_print
- [args] => Array
- (
- [0] => 1
- )
- )
- [1] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doit
- [args] => Array
- (
- [0] => a
- [1] => b
- [2] => backtrace_print
- )
- )
- [2] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doCall
- [class] => foo
- [object] => foo Object
- (
- )
- [type] => ->
- [args] => Array
- (
- [0] => doit
- [1] => backtrace_print
- )
- )
- [3] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => statCall
- [class] => foo
- [type] => ::
- [args] => Array
- (
- [0] => doit
- [1] => backtrace_print
- )
- )
- )
- ==DEBUG_BACKTRACE_IGNORE_ARGS
- Array
- (
- [0] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => 23
- [function] => backtrace_print
- )
- [1] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doit
- )
- [2] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doCall
- [class] => foo
- [type] => ->
- )
- [3] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => statCall
- [class] => foo
- [type] => ::
- )
- )
- ==both
- Array
- (
- [0] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => 25
- [function] => backtrace_print
- )
- [1] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doit
- )
- [2] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => doCall
- [class] => foo
- [object] => foo Object
- (
- )
- [type] => ->
- )
- [3] => Array
- (
- [file] => %sdebug_backtrace_options.php
- [line] => %d
- [function] => statCall
- [class] => foo
- [type] => ::
- )
- )
|