3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * POC for issue with @ error suppression in LemonStand * * Error handle code and example taken from php documents on set_error_handler() * * @see http://www.php.net/manual/en/function.set-error-handler.php */ function myErrorHandler($errNo, $errStr, $errFile, $errLine) { if (!(error_reporting() & $errNo)) { // This error code is not included in error_reporting return; } switch ($errNo) { case E_USER_ERROR: echo "<b>My ERROR</b> [$errNo] $errStr<br />\n"; echo " Fatal error on line $errLine in file $errFile"; echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n"; echo "Aborting...<br />\n"; exit(1); break; case E_USER_WARNING: echo "<b>My WARNING</b> [$errNo] $errStr<br />\n"; break; case E_USER_NOTICE: echo "<b>My NOTICE</b> [$errNo] $errStr<br />\n"; break; default: echo "Unknown error type: [$errNo] $errStr<br />\n"; break; } /* Don't execute PHP internal error handler */ return true; } set_error_handler("myErrorHandler"); @include('foo');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jV8PC
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'myErrorHandler'
          2        DO_ICALL                                                 
   49     3        BEGIN_SILENCE                                    ~1      
          4        INCLUDE_OR_EVAL                                          'foo', INCLUDE
          5        END_SILENCE                                              ~1
          6      > RETURN                                                   1

Function myerrorhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 32
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 39
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Branch analysis from position: 17
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/jV8PC
function name:  myErrorHandler
number of ops:  55
compiled vars:  !0 = $errNo, !1 = $errStr, !2 = $errFile, !3 = $errLine
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   14     4        INIT_FCALL                                               'error_reporting'
          5        DO_ICALL                                         $4      
          6        BW_AND                                           ~5      !0, $4
          7        BOOL_NOT                                         ~6      ~5
          8      > JMPZ                                                     ~6, ->10
   16     9    > > RETURN                                                   null
   19    10    >   IS_EQUAL                                                 !0, 256
         11      > JMPNZ                                                    ~7, ->17
         12    >   IS_EQUAL                                                 !0, 512
         13      > JMPNZ                                                    ~7, ->32
         14    >   IS_EQUAL                                                 !0, 1024
         15      > JMPNZ                                                    ~7, ->39
         16    > > JMP                                                      ->46
   21    17    >   ROPE_INIT                                     5  ~9      '%3Cb%3EMy+ERROR%3C%2Fb%3E+%5B'
         18        ROPE_ADD                                      1  ~9      ~9, !0
         19        ROPE_ADD                                      2  ~9      ~9, '%5D+'
         20        ROPE_ADD                                      3  ~9      ~9, !1
         21        ROPE_END                                      4  ~8      ~9, '%3Cbr+%2F%3E%0A'
         22        ECHO                                                     ~8
   22    23        ROPE_INIT                                     4  ~13     '++Fatal+error+on+line+'
         24        ROPE_ADD                                      1  ~13     ~13, !3
         25        ROPE_ADD                                      2  ~13     ~13, '+in+file+'
         26        ROPE_END                                      3  ~12     ~13, !2
         27        ECHO                                                     ~12
   23    28        ECHO                                                     '%2C+PHP+8.0.0+%28Linux%29%3Cbr+%2F%3E%0A'
   24    29        ECHO                                                     'Aborting...%3Cbr+%2F%3E%0A'
   25    30      > EXIT                                                     1
   26    31*       JMP                                                      ->53
   29    32    >   ROPE_INIT                                     5  ~16     '%3Cb%3EMy+WARNING%3C%2Fb%3E+%5B'
         33        ROPE_ADD                                      1  ~16     ~16, !0
         34        ROPE_ADD                                      2  ~16     ~16, '%5D+'
         35        ROPE_ADD                                      3  ~16     ~16, !1
         36        ROPE_END                                      4  ~15     ~16, '%3Cbr+%2F%3E%0A'
         37        ECHO                                                     ~15
   30    38      > JMP                                                      ->53
   33    39    >   ROPE_INIT                                     5  ~20     '%3Cb%3EMy+NOTICE%3C%2Fb%3E+%5B'
         40        ROPE_ADD                                      1  ~20     ~20, !0
         41        ROPE_ADD                                      2  ~20     ~20, '%5D+'
         42        ROPE_ADD                                      3  ~20     ~20, !1
         43        ROPE_END                                      4  ~19     ~20, '%3Cbr+%2F%3E%0A'
         44        ECHO                                                     ~19
   34    45      > JMP                                                      ->53
   37    46    >   ROPE_INIT                                     5  ~24     'Unknown+error+type%3A+%5B'
         47        ROPE_ADD                                      1  ~24     ~24, !0
         48        ROPE_ADD                                      2  ~24     ~24, '%5D+'
         49        ROPE_ADD                                      3  ~24     ~24, !1
         50        ROPE_END                                      4  ~23     ~24, '%3Cbr+%2F%3E%0A'
         51        ECHO                                                     ~23
   38    52      > JMP                                                      ->53
   42    53    > > RETURN                                                   <true>
   45    54*     > RETURN                                                   null

End of function myerrorhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.69 ms | 1400 KiB | 17 Q