3v4l.org

run code in 300+ PHP versions simultaneously
<?php function eh($type, $message, $file, $line, $context) { unset($context['GLOBALS']); throw new Exception(); } set_error_handler('eh'); try { $a->b; } catch (\Exception $e) { $trace = $e->getTrace(); $trace = $trace[0]['args'][4]; echo isset($trace['GLOBALS']); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M0hLr
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a, !1 = $e, !2 = $trace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'eh'
          2        DO_ICALL                                                 
   12     3        FETCH_OBJ_R                                      ~4      !0, 'b'
          4        FREE                                                     ~4
          5      > JMP                                                      ->16
   13     6  E > > CATCH                                       last         'Exception'
   14     7    >   INIT_METHOD_CALL                                         !1, 'getTrace'
          8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !2, $5
   15    10        FETCH_DIM_R                                      ~7      !2, 0
         11        FETCH_DIM_R                                      ~8      ~7, 'args'
         12        FETCH_DIM_R                                      ~9      ~8, 4
         13        ASSIGN                                                   !2, ~9
   16    14        ISSET_ISEMPTY_DIM_OBJ                         0  ~11     !2, 'GLOBALS'
         15        ECHO                                                     ~11
   17    16    > > RETURN                                                   1

Function eh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/M0hLr
function name:  eh
number of ops:  10
compiled vars:  !0 = $type, !1 = $message, !2 = $file, !3 = $line, !4 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
    5     5        UNSET_DIM                                                !4, 'GLOBALS'
    6     6        NEW                                              $5      'Exception'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $5
    7     9*     > RETURN                                                   null

End of function eh

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.35 ms | 1396 KiB | 15 Q