3v4l.org

run code in 300+ PHP versions simultaneously
<?php $old_error = error_reporting(); $new_old_error = null; $bool = false; $string = ''; $get_last[0] = array(); // error handler function function myErrorHandler($errno, $errstr, $errfile, $errline) { global $new_old_error, $bool, $string, $get_last; $new_old_error = error_reporting(); if (!($new_old_error & $errno)) { // This error code is not included in error_reporting, so let it fall // through to the standard PHP error handler $get_last[] = error_get_last(); error_clear_last(); } else { // $errstr may need to be escaped: $errstr = htmlspecialchars($errstr); switch ($errno) { case E_USER_ERROR: $string = $string . "<b>My ERROR</b> [$errno] $errstr<br />\n"; $string = $string . " Fatal error on line $errline in file $errfile"; $string = $string . ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n"; $string = $string . "Aborting...<br />\n"; exit(1); case E_USER_WARNING: $string = $string . "<b>My WARNING</b> [$errno] $errstr<br />\n"; break; case E_USER_NOTICE: $string = $string . "<b>My NOTICE</b> [$errno] $errstr<br />\n"; break; default: $string = $string . "Unknown error type: [$errno] $errstr<br />\n"; break; } /* Don't execute PHP internal error handler */ $bool = true; } return $bool; } $old_error_handler = set_error_handler("myErrorHandler"); @$arr['is']; @$as['55']; var_dump($string, $get_last, error_get_last());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WaODB
function name:  (null)
number of ops:  28
compiled vars:  !0 = $old_error, !1 = $new_old_error, !2 = $bool, !3 = $string, !4 = $get_last, !5 = $old_error_handler, !6 = $arr, !7 = $as
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        DO_ICALL                                         $8      
          2        ASSIGN                                                   !0, $8
    4     3        ASSIGN                                                   !1, null
    5     4        ASSIGN                                                   !2, <false>
    6     5        ASSIGN                                                   !3, ''
    7     6        ASSIGN_DIM                                               !4, 0
          7        OP_DATA                                                  <array>
   50     8        INIT_FCALL                                               'set_error_handler'
          9        SEND_VAL                                                 'myErrorHandler'
         10        DO_ICALL                                         $14     
         11        ASSIGN                                                   !5, $14
   51    12        BEGIN_SILENCE                                    ~16     
         13        FETCH_DIM_R                                      ~17     !6, 'is'
         14        END_SILENCE                                              ~16
         15        FREE                                                     ~17
   52    16        BEGIN_SILENCE                                    ~18     
         17        FETCH_DIM_R                                      ~19     !7, 55
         18        END_SILENCE                                              ~18
         19        FREE                                                     ~19
   53    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !3
         22        SEND_VAR                                                 !4
         23        INIT_FCALL                                               'error_get_last'
         24        DO_ICALL                                         $20     
         25        SEND_VAR                                                 $20
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Function myerrorhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 54
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 62
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 78
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 78
Branch analysis from position: 78
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 78
Branch analysis from position: 78
Branch analysis from position: 32
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/WaODB
function name:  myErrorHandler
number of ops:  81
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $new_old_error, !5 = $bool, !6 = $string, !7 = $get_last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   12     4        BIND_GLOBAL                                              !4, 'new_old_error'
          5        BIND_GLOBAL                                              !5, 'bool'
          6        BIND_GLOBAL                                              !6, 'string'
          7        BIND_GLOBAL                                              !7, 'get_last'
   13     8        INIT_FCALL                                               'error_reporting'
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !4, $8
   14    11        BW_AND                                           ~10     !4, !0
         12        BOOL_NOT                                         ~11     ~10
         13      > JMPZ                                                     ~11, ->21
   17    14    >   INIT_FCALL                                               'error_get_last'
         15        DO_ICALL                                         $13     
         16        ASSIGN_DIM                                               !7
         17        OP_DATA                                                  $13
   18    18        INIT_FCALL                                               'error_clear_last'
         19        DO_ICALL                                                 
   14    20      > JMP                                                      ->79
   22    21    >   INIT_FCALL                                               'htmlspecialchars'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $15     
         24        ASSIGN                                                   !1, $15
   24    25        IS_EQUAL                                                 !0, 256
         26      > JMPNZ                                                    ~17, ->32
         27    >   IS_EQUAL                                                 !0, 512
         28      > JMPNZ                                                    ~17, ->54
         29    >   IS_EQUAL                                                 !0, 1024
         30      > JMPNZ                                                    ~17, ->62
         31    > > JMP                                                      ->70
   26    32    >   ROPE_INIT                                     5  ~19     '%3Cb%3EMy+ERROR%3C%2Fb%3E+%5B'
         33        ROPE_ADD                                      1  ~19     ~19, !0
         34        ROPE_ADD                                      2  ~19     ~19, '%5D+'
         35        ROPE_ADD                                      3  ~19     ~19, !1
         36        ROPE_END                                      4  ~18     ~19, '%3Cbr+%2F%3E%0A'
         37        CONCAT                                           ~22     !6, ~18
         38        ASSIGN                                                   !6, ~22
   27    39        ROPE_INIT                                     4  ~25     '++Fatal+error+on+line+'
         40        ROPE_ADD                                      1  ~25     ~25, !3
         41        ROPE_ADD                                      2  ~25     ~25, '+in+file+'
         42        ROPE_END                                      3  ~24     ~25, !2
         43        CONCAT                                           ~27     !6, ~24
         44        ASSIGN                                                   !6, ~27
   28    45        CONCAT                                           ~29     !6, '%2C+PHP+'
         46        CONCAT                                           ~30     ~29, '8.3.0'
         47        CONCAT                                           ~31     ~30, '+%28'
         48        CONCAT                                           ~32     ~31, 'Linux'
         49        CONCAT                                           ~33     ~32, '%29%3Cbr+%2F%3E%0A'
         50        ASSIGN                                                   !6, ~33
   29    51        CONCAT                                           ~35     !6, 'Aborting...%3Cbr+%2F%3E%0A'
         52        ASSIGN                                                   !6, ~35
   30    53      > EXIT                                                     1
   33    54    >   ROPE_INIT                                     5  ~38     '%3Cb%3EMy+WARNING%3C%2Fb%3E+%5B'
         55        ROPE_ADD                                      1  ~38     ~38, !0
         56        ROPE_ADD                                      2  ~38     ~38, '%5D+'
         57        ROPE_ADD                                      3  ~38     ~38, !1
         58        ROPE_END                                      4  ~37     ~38, '%3Cbr+%2F%3E%0A'
         59        CONCAT                                           ~41     !6, ~37
         60        ASSIGN                                                   !6, ~41
   34    61      > JMP                                                      ->78
   37    62    >   ROPE_INIT                                     5  ~44     '%3Cb%3EMy+NOTICE%3C%2Fb%3E+%5B'
         63        ROPE_ADD                                      1  ~44     ~44, !0
         64        ROPE_ADD                                      2  ~44     ~44, '%5D+'
         65        ROPE_ADD                                      3  ~44     ~44, !1
         66        ROPE_END                                      4  ~43     ~44, '%3Cbr+%2F%3E%0A'
         67        CONCAT                                           ~47     !6, ~43
         68        ASSIGN                                                   !6, ~47
   38    69      > JMP                                                      ->78
   41    70    >   ROPE_INIT                                     5  ~50     'Unknown+error+type%3A+%5B'
         71        ROPE_ADD                                      1  ~50     ~50, !0
         72        ROPE_ADD                                      2  ~50     ~50, '%5D+'
         73        ROPE_ADD                                      3  ~50     ~50, !1
         74        ROPE_END                                      4  ~49     ~50, '%3Cbr+%2F%3E%0A'
         75        CONCAT                                           ~53     !6, ~49
         76        ASSIGN                                                   !6, ~53
   42    77      > JMP                                                      ->78
   46    78    >   ASSIGN                                                   !5, <true>
   48    79    > > RETURN                                                   !5
   49    80*     > RETURN                                                   null

End of function myerrorhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.68 ms | 1441 KiB | 19 Q