3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler('myErrorHandler'); register_shutdown_function('fatalErrorShutdownHandler'); function myErrorHandler($code, $message, $file, $line) { if (strpos($message, 'Class')) { var_dump('foo'); return true; } } function fatalErrorShutdownHandler() { echo 'foo'; $last_error = error_get_last(); if ($last_error['type'] === E_ERROR) { // fatal error myErrorHandler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']); } } Everything::is('awesome'); echo Everything;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rt5q4
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'myErrorHandler'
          2        DO_ICALL                                                 
    5     3        INIT_FCALL                                               'register_shutdown_function'
          4        SEND_VAL                                                 'fatalErrorShutdownHandler'
          5        DO_ICALL                                                 
   27     6        INIT_STATIC_METHOD_CALL                                  'Everything', 'is'
          7        SEND_VAL_EX                                              'awesome'
          8        DO_FCALL                                      0          
   29     9        FETCH_CONSTANT                                   ~3      'Everything'
         10        ECHO                                                     ~3
         11      > RETURN                                                   1

Function myerrorhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rt5q4
function name:  myErrorHandler
number of ops:  14
compiled vars:  !0 = $code, !1 = $message, !2 = $file, !3 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    8     4        INIT_FCALL                                               'strpos'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 'Class'
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->13
    9     9    >   INIT_FCALL                                               'var_dump'
         10        SEND_VAL                                                 'foo'
         11        DO_ICALL                                                 
   10    12      > RETURN                                                   <true>
   12    13    > > RETURN                                                   null

End of function myerrorhandler

Function fatalerrorshutdownhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/Rt5q4
function name:  fatalErrorShutdownHandler
number of ops:  17
compiled vars:  !0 = $last_error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'foo'
   17     1        INIT_FCALL                                               'error_get_last'
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
   18     4        FETCH_DIM_R                                      ~3      !0, 'type'
          5        IS_IDENTICAL                                             ~3, 1
          6      > JMPZ                                                     ~4, ->16
   20     7    >   INIT_FCALL                                               'myerrorhandler'
          8        SEND_VAL                                                 1
          9        FETCH_DIM_R                                      ~5      !0, 'message'
         10        SEND_VAL                                                 ~5
         11        FETCH_DIM_R                                      ~6      !0, 'file'
         12        SEND_VAL                                                 ~6
         13        FETCH_DIM_R                                      ~7      !0, 'line'
         14        SEND_VAL                                                 ~7
         15        DO_FCALL                                      0          
   22    16    > > RETURN                                                   null

End of function fatalerrorshutdownhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.41 ms | 1403 KiB | 24 Q