3v4l.org

run code in 300+ PHP versions simultaneously
<?php function call_debug_backtrace($errno, $errstr) { static $call = 0; $call++; echo "call {$call}: {$errstr}\n"; $bt = debug_backtrace(); $args = $bt[1]["args"]; foreach ($args as $k => $v) { $n = $k + 1; echo "call {$call}: argument {$n} is '{$v}'\n"; $args[$k] = "altered {$call}:{$n}"; $bt2 = debug_backtrace(); if ($bt2[1]["args"][$k] === $args[$k]) { echo "call {$call}: updated argument {$n} to '{$args[$k]}'\n"; } } } set_error_handler("call_debug_backtrace"); function foo($a, stdClass $b, stdClass $c) { var_dump($a); var_dump($b); var_dump($c); } foo(1, 2, 3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7B3jB
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'call_debug_backtrace'
          2        DO_ICALL                                                 
   28     3        INIT_FCALL                                               'foo'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 2
          6        SEND_VAL                                                 3
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function call_debug_backtrace:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 54
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 54
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 53
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 53
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
filename:       /in/7B3jB
function name:  call_debug_backtrace
number of ops:  56
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $call, !3 = $bt, !4 = $args, !5 = $v, !6 = $k, !7 = $n, !8 = $bt2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        BIND_STATIC                                              !2
          3        PRE_INC                                                  !2
    5     4        ROPE_INIT                                     5  ~11     'call+'
          5        ROPE_ADD                                      1  ~11     ~11, !2
          6        ROPE_ADD                                      2  ~11     ~11, '%3A+'
          7        ROPE_ADD                                      3  ~11     ~11, !1
          8        ROPE_END                                      4  ~10     ~11, '%0A'
          9        ECHO                                                     ~10
    7    10        INIT_FCALL                                               'debug_backtrace'
         11        DO_ICALL                                         $14     
         12        ASSIGN                                                   !3, $14
    8    13        FETCH_DIM_R                                      ~16     !3, 1
         14        FETCH_DIM_R                                      ~17     ~16, 'args'
         15        ASSIGN                                                   !4, ~17
    9    16      > FE_RESET_R                                       $19     !4, ->54
         17    > > FE_FETCH_R                                       ~20     $19, !5, ->54
         18    >   ASSIGN                                                   !6, ~20
         19        ADD                                              ~22     !6, 1
         20        ASSIGN                                                   !7, ~22
   10    21        ROPE_INIT                                     7  ~25     'call+'
         22        ROPE_ADD                                      1  ~25     ~25, !2
         23        ROPE_ADD                                      2  ~25     ~25, '%3A+argument+'
         24        ROPE_ADD                                      3  ~25     ~25, !7
         25        ROPE_ADD                                      4  ~25     ~25, '+is+%27'
         26        ROPE_ADD                                      5  ~25     ~25, !5
         27        ROPE_END                                      6  ~24     ~25, '%27%0A'
         28        ECHO                                                     ~24
   11    29        ROPE_INIT                                     4  ~31     'altered+'
         30        ROPE_ADD                                      1  ~31     ~31, !2
         31        ROPE_ADD                                      2  ~31     ~31, '%3A'
         32        ROPE_END                                      3  ~30     ~31, !7
         33        ASSIGN_DIM                                               !4, !6
         34        OP_DATA                                                  ~30
   13    35        INIT_FCALL                                               'debug_backtrace'
         36        DO_ICALL                                         $33     
         37        ASSIGN                                                   !8, $33
   14    38        FETCH_DIM_R                                      ~35     !8, 1
         39        FETCH_DIM_R                                      ~36     ~35, 'args'
         40        FETCH_DIM_R                                      ~37     ~36, !6
         41        FETCH_DIM_R                                      ~38     !4, !6
         42        IS_IDENTICAL                                             ~37, ~38
         43      > JMPZ                                                     ~39, ->53
   15    44    >   ROPE_INIT                                     7  ~42     'call+'
         45        ROPE_ADD                                      1  ~42     ~42, !2
         46        ROPE_ADD                                      2  ~42     ~42, '%3A+updated+argument+'
         47        ROPE_ADD                                      3  ~42     ~42, !7
         48        ROPE_ADD                                      4  ~42     ~42, '+to+%27'
         49        FETCH_DIM_R                                      ~40     !4, !6
         50        ROPE_ADD                                      5  ~42     ~42, ~40
         51        ROPE_END                                      6  ~41     ~42, '%27%0A'
         52        ECHO                                                     ~41
    9    53    > > JMP                                                      ->17
         54    >   FE_FREE                                                  $19
   18    55      > RETURN                                                   null

End of function call_debug_backtrace

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7B3jB
function name:  foo
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   23     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   24     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   25     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
   26    12      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.24 ms | 1411 KiB | 20 Q