3v4l.org

run code in 500+ 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:/in/HkWfh:15}
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 = 61) Position 1 = -2
filename:       /in/HkWfh
function name:  foo
number of ops:  13
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      > INIT_FCALL                                                   'exit'
         11*       DO_ICALL                                                     
   10    12*     > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.38 ms | 2742 KiB | 13 Q