3v4l.org

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

Class Handler:
Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoRio
function name:  register
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     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
    6     7*     > RETURN                                                   null

End of function register

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

End of function handle

End of class Handler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.47 ms | 1387 KiB | 15 Q