3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Handler { public function register() { return set_exception_handler(array($this, 'handle')); } public function handle($e) { die("Exception reached"); } } $h = (new Handler())->register(); var_dump($h); throw new Exception("i111111 Not handled"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/ZdReG
function name:  (null)
number of ops:  13
compiled vars:  !0 = $h
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Handler'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'register'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   14     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   15     8        NEW                                              $6      'Exception'
          9        SEND_VAL_EX                                              'i111111+Not+handled'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $6
   16    12*     > RETURN                                                   1

Class Handler:
Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZdReG
function name:  register
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'handle'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    5     7*     > RETURN                                                   null

End of function register

Function handle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/ZdReG
function name:  handle
number of ops:  3
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1      > EXIT                                                     'Exception+reached'
    9     2*     > RETURN                                                   null

End of function handle

End of class Handler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.3 ms | 1401 KiB | 17 Q