3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); echo PHP_EOL; set_exception_handler( function () { echo 'set_exception_handler' . PHP_EOL; die(); } ); set_error_handler( function () { echo 'set_error_handler' . PHP_EOL; die(); } ); register_shutdown_function( function () { echo 'register_shutdown_function' . PHP_EOL; if (null === $error = error_get_last()) { return; } echo 'register_shutdown_function WITH exception' . PHP_EOL; throw new ErrorException('!!!'); } ); // set_exception_handler //throw new \Error('qq'); // set_exception_handler //throw new \RuntimeException('qq'); // set_error_handler //$a=b; // register_shutdown_function WITH exception ini_set('memory_limit', '1KB'); $a = []; for ($i = 1; $i <= 10000000; $i++) { $a[] = new stdClass(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 20
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 20
Branch analysis from position: 27
Branch analysis from position: 20
filename:       /in/NhU2A
function name:  (null)
number of ops:  28
compiled vars:  !0 = $a, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     '%0A'
    5     1        INIT_FCALL                                               'set_exception_handler'
    6     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNhU2A%3A6%240'
    9     3        SEND_VAL                                                 ~2
          4        DO_ICALL                                                 
   12     5        INIT_FCALL                                               'set_error_handler'
   13     6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNhU2A%3A13%241'
   16     7        SEND_VAL                                                 ~4
          8        DO_ICALL                                                 
   19     9        INIT_FCALL                                               'register_shutdown_function'
   20    10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNhU2A%3A20%242'
   28    11        SEND_VAL                                                 ~6
         12        DO_ICALL                                                 
   46    13        INIT_FCALL                                               'ini_set'
         14        SEND_VAL                                                 'memory_limit'
         15        SEND_VAL                                                 '1KB'
         16        DO_ICALL                                                 
   47    17        ASSIGN                                                   !0, <array>
   48    18        ASSIGN                                                   !1, 1
         19      > JMP                                                      ->25
   49    20    >   NEW                                              $12     'stdClass'
         21        DO_FCALL                                      0          
         22        ASSIGN_DIM                                               !0
         23        OP_DATA                                                  $12
   48    24        PRE_INC                                                  !1
         25    >   IS_SMALLER_OR_EQUAL                                      !1, 10000000
         26      > JMPNZ                                                    ~15, ->20
   50    27    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FNhU2A%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/NhU2A
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'set_exception_handler%0A'
    8     1      > EXIT                                                     
    9     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNhU2A%3A6%240

Function %00%7Bclosure%7D%2Fin%2FNhU2A%3A13%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/NhU2A
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'set_error_handler%0A'
   15     1      > EXIT                                                     
   16     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNhU2A%3A13%241

Function %00%7Bclosure%7D%2Fin%2FNhU2A%3A20%242:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/NhU2A
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'register_shutdown_function%0A'
   22     1        INIT_FCALL                                               'error_get_last'
          2        DO_ICALL                                         $1      
          3        ASSIGN                                           ~2      !0, $1
          4        TYPE_CHECK                                    2          ~2
          5      > JMPZ                                                     ~3, ->7
   23     6    > > RETURN                                                   null
   26     7    >   ECHO                                                     'register_shutdown_function+WITH+exception%0A'
   27     8        NEW                                              $4      'ErrorException'
          9        SEND_VAL_EX                                              '%21%21%21'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $4
   28    12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNhU2A%3A20%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.81 ms | 1400 KiB | 23 Q