3v4l.org

run code in 300+ PHP versions simultaneously
<?php $old_error = error_reporting(); $new_old_error = null; $bool = false; $string = ''; $get_last = 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']; var_dump($string, $get_last);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6DbhM
function name:  (null)
number of ops:  20
compiled vars:  !0 = $old_error, !1 = $new_old_error, !2 = $bool, !3 = $string, !4 = $get_last, !5 = $old_error_handler, !6 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        DO_ICALL                                         $7      
          2        ASSIGN                                                   !0, $7
    4     3        ASSIGN                                                   !1, null
    5     4        ASSIGN                                                   !2, <false>
    6     5        ASSIGN                                                   !3, ''
    7     6        ASSIGN                                                   !4, <array>
   50     7        INIT_FCALL                                               'set_error_handler'
          8        SEND_VAL                                                 'myErrorHandler'
          9        DO_ICALL                                         $13     
         10        ASSIGN                                                   !5, $13
   51    11        BEGIN_SILENCE                                    ~15     
         12        FETCH_DIM_R                                      ~16     !6, 'is'
         13        END_SILENCE                                              ~15
         14        FREE                                                     ~16
   52    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

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

End of function myerrorhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.96 ms | 1439 KiB | 18 Q