3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo( $arg ) { echo "exception callback" . PHP_EOL; } set_exception_handler( 'foo' ); function bar( $arg ) { throw new Exception( 'fail here' ); } ob_start( 'bar' ); echo "start" . PHP_EOL; ob_flush(); echo "continue" . PHP_EOL; ob_flush(); echo "done";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S7f87
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        SEND_VAL                                                 'foo'
          2        DO_ICALL                                                 
   13     3        INIT_FCALL                                               'ob_start'
          4        SEND_VAL                                                 'bar'
          5        DO_ICALL                                                 
   15     6        ECHO                                                     'start%0A'
   17     7        INIT_FCALL                                               'ob_flush'
          8        DO_ICALL                                                 
   19     9        ECHO                                                     'continue%0A'
   21    10        INIT_FCALL                                               'ob_flush'
         11        DO_ICALL                                                 
   23    12        ECHO                                                     'done'
         13      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S7f87
function name:  foo
number of ops:  3
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     'exception+callback%0A'
    5     2      > RETURN                                                   null

End of function foo

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

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.7 ms | 1001 KiB | 16 Q