3v4l.org

run code in 300+ PHP versions simultaneously
<?php $handler = function() { echo 'error handler!'; throw new \ErrorException(); }; set_error_handler($handler); register_shutdown_function($handler); try { fatal_error(); } catch (\Exception $e) { echo 'caught!'; } echo 'done';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d5mjJ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $handler, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fd5mjJ%3A2%240'
          1        ASSIGN                                                   !0, ~2
    3     2        INIT_FCALL                                               'set_error_handler'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    4     5        INIT_FCALL                                               'register_shutdown_function'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
    7     8        INIT_FCALL_BY_NAME                                       'fatal_error'
          9        DO_FCALL                                      0          
         10      > JMP                                                      ->13
    8    11  E > > CATCH                                       last         'Exception'
    9    12    >   ECHO                                                     'caught%21'
   12    13    >   ECHO                                                     'done'
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fd5mjJ%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/d5mjJ
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'error+handler%21'
          1        NEW                                              $0      'ErrorException'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fd5mjJ%3A2%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.18 ms | 1395 KiB | 17 Q