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

End of function myerrorhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.86 ms | 1400 KiB | 15 Q