3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function foo($e) { var_dump( set_exception_handler('foo') ); restore_exception_handler(); echo "---" . PHP_EOL; exit; } set_exception_handler('foo'); register_shutdown_function(function () { var_dump( set_exception_handler(null) ); }); strlen(null);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HkWfh
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        SEND_VAL                                                 'foo'
          2        DO_ICALL                                                 
   15     3        INIT_FCALL                                               'register_shutdown_function'
          4        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
   17     5        SEND_VAL                                                 ~1
   15     6        DO_ICALL                                                 
   20     7        STRLEN                                           ~3      null
          8        FREE                                                     ~3
          9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HkWfh
function name:  {closure}
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'set_exception_handler'
          2        SEND_VAL                                                 null
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   17     6      > RETURN                                                   null

End of Dynamic Function 0

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/HkWfh
function name:  foo
number of ops:  12
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'set_exception_handler'
          3        SEND_VAL                                                 'foo'
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
    7     7        INIT_FCALL                                               'restore_exception_handler'
          8        DO_ICALL                                                 
    8     9        ECHO                                                     '---%0A'
    9    10      > EXIT                                                     
   10    11*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.33 ms | 1002 KiB | 17 Q