3v4l.org

run code in 500+ PHP versions simultaneously
<?php error_reporting(E_ALL | E_STRICT); // Custom error handler. function handle_error($code, $message, $file, $line, $context) { $code = $code & error_reporting(); if ($code == 0) { // skip @ suppressed errors. return; } $errors = array( E_ERROR => 'E_ERROR', E_WARNING => 'E_WARNING', E_PARSE => 'E_PARSE', E_NOTICE => 'E_NOTICE', E_CORE_ERROR => 'E_CORE_ERROR', E_CORE_WARNING => 'E_CORE_WARNING', E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING', E_USER_ERROR => 'E_USER_ERROR', E_USER_WARNING => 'E_USER_WARNING', E_USER_NOTICE => 'E_USER_NOTICE', E_STRICT => 'E_STRICT', E_DEPRECATED => 'E_DEPRECATED', ); if (array_key_exists($code, $errors)) { $errname = $errors[$code]; } else { $errname = $code; } $error = "Error handler caught $errname with message \"" . $message . '" at ' . $file . ' line ' . $line . ".\n"; error_log($error); eval(<<<'PHP' function bla() { print "You should see this.\n"; } PHP ); bla($error); return; } set_error_handler('handle_error'); // This fails because bla.php can't be required in error handler: eval(<<<'PHP' namespace MyNamespace { abstract class AbstractFoo { abstract public static function foo(); // PHP 5.3 issues an E_STRICT here about abstract + static, even though it now supports static inheritance. } } PHP );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TjXg7
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'error_reporting'
          1        FETCH_CONSTANT                                       ~0      'E_STRICT'
          2        BW_OR                                                ~1      ~0, 30719
          3        SEND_VAL                                                     ~1
          4        DO_ICALL                                                     
   42     5        INIT_FCALL                                                   'set_error_handler'
          6        SEND_VAL                                                     'handle_error'
          7        DO_ICALL                                                     
   46     8        INCLUDE_OR_EVAL                                              'namespace+MyNamespace+%7B%0A%09abstract+class+AbstractFoo+%7B%0A%09%09abstract+public+static+function+foo%28%29%3B+%2F%2F+PHP+5.3+issues+an+E_STRICT+here+about+abstract+%2B+static%2C+even+though+it+now+supports+static+inheritance.%0A%09%7D%0A%7D', EVAL
   52     9      > RETURN                                                       1

Function handle_error:
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
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TjXg7
function name:  handle_error
number of ops:  52
compiled vars:  !0 = $code, !1 = $message, !2 = $file, !3 = $line, !4 = $context, !5 = $errors, !6 = $errname, !7 = $error
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
          3        RECV                                                 !3      
          4        RECV                                                 !4      
    6     5        INIT_FCALL                                                   'error_reporting'
          6        DO_ICALL                                             $8      
          7        BW_AND                                               ~9      !0, $8
          8        ASSIGN                                                       !0, ~9
    7     9        IS_EQUAL                                                     !0, 0
         10      > JMPZ                                                         ~11, ->12
    8    11    > > RETURN                                                       null
   11    12    >   INIT_ARRAY                                           ~12     'E_ERROR', 1
   12    13        ADD_ARRAY_ELEMENT                                    ~12     'E_WARNING', 2
   13    14        ADD_ARRAY_ELEMENT                                    ~12     'E_PARSE', 4
   14    15        ADD_ARRAY_ELEMENT                                    ~12     'E_NOTICE', 8
   15    16        ADD_ARRAY_ELEMENT                                    ~12     'E_CORE_ERROR', 16
   16    17        ADD_ARRAY_ELEMENT                                    ~12     'E_CORE_WARNING', 32
   17    18        ADD_ARRAY_ELEMENT                                    ~12     'E_COMPILE_ERROR', 64
   18    19        ADD_ARRAY_ELEMENT                                    ~12     'E_COMPILE_WARNING', 128
   19    20        ADD_ARRAY_ELEMENT                                    ~12     'E_USER_ERROR', 256
   20    21        ADD_ARRAY_ELEMENT                                    ~12     'E_USER_WARNING', 512
   21    22        ADD_ARRAY_ELEMENT                                    ~12     'E_USER_NOTICE', 1024
   22    23        FETCH_CONSTANT                                       ~13     'E_STRICT'
         24        ADD_ARRAY_ELEMENT                                    ~12     'E_STRICT', ~13
   23    25        ADD_ARRAY_ELEMENT                                    ~12     'E_DEPRECATED', 8192
   10    26        ASSIGN                                                       !5, ~12
   25    27        ARRAY_KEY_EXISTS                                             !0, !5
         28      > JMPZ                                                         ~15, ->32
   26    29    >   FETCH_DIM_R                                          ~16     !5, !0
         30        ASSIGN                                                       !6, ~16
   25    31      > JMP                                                          ->33
   29    32    >   ASSIGN                                                       !6, !0
   31    33    >   ROPE_INIT                                         3  ~20     'Error+handler+caught+'
         34        ROPE_ADD                                          1  ~20     ~20, !6
         35        ROPE_END                                          2  ~19     ~20, '+with+message+%22'
         36        CONCAT                                               ~22     ~19, !1
         37        CONCAT                                               ~23     ~22, '%22+at+'
         38        CONCAT                                               ~24     ~23, !2
         39        CONCAT                                               ~25     ~24, '+line+'
         40        CONCAT                                               ~26     ~25, !3
         41        CONCAT                                               ~27     ~26, '.%0A'
         42        ASSIGN                                                       !7, ~27
   32    43        INIT_FCALL                                                   'error_log'
         44        SEND_VAR                                                     !7
         45        DO_ICALL                                                     
   34    46        INCLUDE_OR_EVAL                                              'function+bla%28%29+%7B%0A%09print+%22You+should+see+this.%5Cn%22%3B%0A%7D', EVAL
   39    47        INIT_FCALL_BY_NAME                                           'bla'
         48        SEND_VAR_EX                                                  !7
         49        DO_FCALL                                          0          
   40    50      > RETURN                                                       null
   41    51*     > RETURN                                                       null

End of function handle_error

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.96 ms | 2241 KiB | 16 Q