3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler( function($error_num, $message, $file_name, $line_num) { $trace = debug_backtrace(); foreach($trace as $trace_row){ array_walk_recursive($trace, function(&$val, $index){ $max_length = 100; //The strlen(...) function has to be passed a string value, so convert objects to their respective class names - otherwise an error will be thrown if ( is_object($val) ) { $val = get_class($val); } $length = strlen($val); if( $length > $max_length ){ $val = substr($val, 0, $max_length) . "...(original length $length)"; } }); } return true; } ); class A{ function do_stuff(&$b) { var_dump('Before in function:', $b); $defined = 0; #trigger_error("If I fixed the undefined variable but enabled this line instead, it will also turn b from an object into a string! So user-triggered notices bork it as well."); $x = $undefined || $defined ? 14 : 0; var_dump('After in function:', $b); } } class B{} $a = new A(); $b = new B(); $a->do_stuff($b); var_dump('After function:', $b); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FUqWS
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'set_error_handler'
    3     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFUqWS%3A3%240'
   22     2        SEND_VAL                                                 ~2
          3        DO_ICALL                                                 
   37     4        NEW                                              $4      'A'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
   38     7        NEW                                              $7      'B'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   40    10        INIT_METHOD_CALL                                         !0, 'do_stuff'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   42    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAL                                                 'After+function%3A'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   43    17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFUqWS%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/FUqWS
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $error_num, !1 = $message, !2 = $file_name, !3 = $line_num, !4 = $trace, !5 = $trace_row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4        INIT_FCALL                                               'debug_backtrace'
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !4, $6
    5     7      > FE_RESET_R                                       $8      !4, ->15
          8    > > FE_FETCH_R                                               $8, !5, ->15
    6     9    >   INIT_FCALL                                               'array_walk_recursive'
         10        SEND_REF                                                 !4
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFUqWS%3A6%241'
   18    12        SEND_VAL                                                 ~9
         13        DO_ICALL                                                 
    5    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $8
   21    16      > RETURN                                                   <true>
   22    17*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFUqWS%3A3%240

Function %00%7Bclosure%7D%2Fin%2FFUqWS%3A6%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 21
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 7
filename:       /in/FUqWS
function name:  {closure}
number of ops:  22
compiled vars:  !0 = $val, !1 = $index, !2 = $max_length, !3 = $length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        ASSIGN                                                   !2, 100
   10     3        TYPE_CHECK                                  256          !0
          4      > JMPZ                                                     ~5, ->7
   11     5    >   GET_CLASS                                        ~6      !0
          6        ASSIGN                                                   !0, ~6
   13     7    >   STRLEN                                           ~8      !0
          8        ASSIGN                                                   !3, ~8
   15     9        IS_SMALLER                                               !2, !3
         10      > JMPZ                                                     ~10, ->21
   16    11    >   INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 0
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $11     
         16        ROPE_INIT                                     3  ~13     '...%28original+length+'
         17        ROPE_ADD                                      1  ~13     ~13, !3
         18        ROPE_END                                      2  ~12     ~13, '%29'
         19        CONCAT                                           ~15     $11, ~12
         20        ASSIGN                                                   !0, ~15
   18    21    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFUqWS%3A6%241

Class A:
Function do_stuff:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/FUqWS
function name:  do_stuff
number of ops:  18
compiled vars:  !0 = $b, !1 = $defined, !2 = $x, !3 = $undefined
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Before+in+function%3A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   28     5        ASSIGN                                                   !1, 0
   30     6      > JMPNZ_EX                                         ~6      !3, ->8
          7    >   BOOL                                             ~6      !1
          8    > > JMPZ                                                     ~6, ->11
          9    >   QM_ASSIGN                                        ~7      14
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~7      0
         12    >   ASSIGN                                                   !2, ~7
   31    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAL                                                 'After+in+function%3A'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   32    17      > RETURN                                                   null

End of function do_stuff

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.17 ms | 1404 KiB | 23 Q