3v4l.org

run code in 300+ PHP versions simultaneously
<?php function handleError($severity, $errstr, $errfile, $errline) { \error_clear_last(); if (!(\error_reporting() & $severity)) { return true; // Silenced } var_dump('ERROR!'); } set_error_handler('handleError'); register_shutdown_function(function () { var_dump('Shutdown'); // if the script dies while in a silent operator \error_reporting(E_ALL); // trigger gc to increase the chance to log "not enough memory" errors \gc_collect_cycles(); $error = \error_get_last(); if ($error !== null) { try { handleError($error['type'], $error['message'], $error['file'], $error['line']); } catch (\Throwable $e) { } } }); // actual script @\gzuncompress('blub');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LClmp
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'handleError'
          2        DO_ICALL                                                 
   16     3        INIT_FCALL                                               'register_shutdown_function'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FLClmp%3A16%240'
   31     5        SEND_VAL                                                 ~1
          6        DO_ICALL                                                 
   37     7        BEGIN_SILENCE                                    ~3      
          8        INIT_FCALL                                               'gzuncompress'
          9        SEND_VAL                                                 'blub'
         10        DO_ICALL                                                 
         11        END_SILENCE                                              ~3
         12      > RETURN                                                   1

Function handleerror:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LClmp
function name:  handleError
number of ops:  16
compiled vars:  !0 = $severity, !1 = $errstr, !2 = $errfile, !3 = $errline
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    5     4        INIT_FCALL                                               'error_clear_last'
          5        DO_ICALL                                                 
    7     6        INIT_FCALL                                               'error_reporting'
          7        DO_ICALL                                         $5      
          8        BW_AND                                           ~6      !0, $5
          9        BOOL_NOT                                         ~7      ~6
         10      > JMPZ                                                     ~7, ->12
    8    11    > > RETURN                                                   <true>
   11    12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAL                                                 'ERROR%21'
         14        DO_ICALL                                                 
   12    15      > RETURN                                                   null

End of function handleerror

Function %00%7Bclosure%7D%2Fin%2FLClmp%3A16%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Found catch point at position: 24
Branch analysis from position: 24
2 jumps found. (Code = 107) Position 1 = 25, Position 2 = -2
Branch analysis from position: 25
filename:       /in/LClmp
function name:  {closure}
number of ops:  26
compiled vars:  !0 = $error, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Shutdown'
          2        DO_ICALL                                                 
   19     3        INIT_FCALL                                               'error_reporting'
          4        SEND_VAL                                                 32767
          5        DO_ICALL                                                 
   22     6        INIT_FCALL                                               'gc_collect_cycles'
          7        DO_ICALL                                                 
   24     8        INIT_FCALL                                               'error_get_last'
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !0, $5
   25    11        TYPE_CHECK                                  1020          !0
         12      > JMPZ                                                     ~7, ->25
   27    13    >   INIT_FCALL                                               'handleerror'
         14        FETCH_DIM_R                                      ~8      !0, 'type'
         15        SEND_VAL                                                 ~8
         16        FETCH_DIM_R                                      ~9      !0, 'message'
         17        SEND_VAL                                                 ~9
         18        FETCH_DIM_R                                      ~10     !0, 'file'
         19        SEND_VAL                                                 ~10
         20        FETCH_DIM_R                                      ~11     !0, 'line'
         21        SEND_VAL                                                 ~11
         22        DO_FCALL                                      0          
         23      > JMP                                                      ->25
   28    24  E > > CATCH                                       last         'Throwable'
   31    25    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FLClmp%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
14.6 ms | 466 KiB | 7 Q