3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = ['array' => 'of stuff', 'toodles' => 14 ]; function boom(array &$b) { throw new Exception('kablooey'); } try { boom($a); } catch(Exception $e) { echo var_dump($a); $aStack = $e->getTrace(); foreach($aStack as &$aItem) { if(isset($aItem['args'])) { foreach($aItem['args'] as &$aArg) { $aArg = 'destroyed'; } } } echo var_dump($a); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
2 jumps found. (Code = 125) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
2 jumps found. (Code = 126) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 125) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
2 jumps found. (Code = 126) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 22
Branch analysis from position: 23
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/SunjY
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a, !1 = $e, !2 = $aStack, !3 = $aItem, !4 = $aArg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    8     1        INIT_FCALL                                                   'boom'
          2        SEND_REF                                                     !0
          3        DO_FCALL                                          0          
          4      > JMP                                                          ->29
    9     5  E > > CATCH                                           last         'Exception'
   10     6    >   INIT_FCALL                                                   'var_dump'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                             $7      
          9        ECHO                                                         $7
   11    10        INIT_METHOD_CALL                                             !1, 'getTrace'
         11        DO_FCALL                                          0  $8      
         12        ASSIGN                                                       !2, $8
   12    13      > FE_RESET_RW                                          $10     !2, ->24
         14    > > FE_FETCH_RW                                                  $10, !3, ->24
   13    15    >   ISSET_ISEMPTY_DIM_OBJ                             0          !3, 'args'
         16      > JMPZ                                                         ~11, ->23
   14    17    >   FETCH_DIM_W                                          $12     !3, 'args'
         18      > FE_RESET_RW                                          $13     $12, ->22
         19    > > FE_FETCH_RW                                                  $13, !4, ->22
   15    20    >   ASSIGN                                                       !4, 'destroyed'
   14    21      > JMP                                                          ->19
         22    >   FE_FREE                                                      $13
   12    23    > > JMP                                                          ->14
         24    >   FE_FREE                                                      $10
   19    25        INIT_FCALL                                                   'var_dump'
         26        SEND_VAR                                                     !0
         27        DO_ICALL                                             $15     
         28        ECHO                                                         $15
   20    29    > > RETURN                                                       1

Function boom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/SunjY
function name:  boom
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        NEW                                                  $1      'Exception'
          2        SEND_VAL_EX                                                  'kablooey'
          3        DO_FCALL                                          0          
          4      > THROW                                             0          $1
    6     5*     > RETURN                                                       null

End of function boom

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.25 ms | 2063 KiB | 15 Q