3v4l.org

run code in 300+ PHP versions simultaneously
<?php $badScript = '<?php /* Broken comment '; $filename = tempnam(sys_get_temp_dir(), 'badScript'); file_put_contents($filename, $badScript); function examine($text, $filename, $errorReporting, $displayErrors) { error_reporting($errorReporting); ini_set('display_errors', $displayErrors); ini_set('log_errors', $displayErrors); echo 'error_reporting = ', $errorReporting, PHP_EOL, 'display_errors = ', $displayErrors, PHP_EOL, 'log_errors = ', $displayErrors, PHP_EOL; error_clear_last(); highlight_string($text, true); echo 'highlight_string(): ', (error_get_last() ? 'error' : 'no error'), PHP_EOL; error_clear_last(); highlight_file($filename, true); echo 'highlight_file(): ', (error_get_last() ? 'error' : 'no error'), PHP_EOL; } examine($badScript, $filename, -1, 1); examine($badScript, $filename, -1, 0); examine($badScript, $filename, 0, 1); examine($badScript, $filename, 0, 0); unlink($filename);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gHjNG
function name:  (null)
number of ops:  40
compiled vars:  !0 = $badScript, !1 = $filename
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fphp%0A%2F%2A+Broken+comment%0A'
    7     1        INIT_FCALL                                               'tempnam'
          2        INIT_FCALL                                               'sys_get_temp_dir'
          3        DO_ICALL                                         $3      
          4        SEND_VAR                                                 $3
          5        SEND_VAL                                                 'badScript'
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
    8     8        INIT_FCALL                                               'file_put_contents'
          9        SEND_VAR                                                 !1
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   30    12        INIT_FCALL                                               'examine'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        SEND_VAL                                                 -1
         16        SEND_VAL                                                 1
         17        DO_FCALL                                      0          
   31    18        INIT_FCALL                                               'examine'
         19        SEND_VAR                                                 !0
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 -1
         22        SEND_VAL                                                 0
         23        DO_FCALL                                      0          
   32    24        INIT_FCALL                                               'examine'
         25        SEND_VAR                                                 !0
         26        SEND_VAR                                                 !1
         27        SEND_VAL                                                 0
         28        SEND_VAL                                                 1
         29        DO_FCALL                                      0          
   33    30        INIT_FCALL                                               'examine'
         31        SEND_VAR                                                 !0
         32        SEND_VAR                                                 !1
         33        SEND_VAL                                                 0
         34        SEND_VAL                                                 0
         35        DO_FCALL                                      0          
   34    36        INIT_FCALL                                               'unlink'
         37        SEND_VAR                                                 !1
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Function examine:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 51
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 51
Branch analysis from position: 49
Branch analysis from position: 51
filename:       /in/gHjNG
function name:  examine
number of ops:  55
compiled vars:  !0 = $text, !1 = $filename, !2 = $errorReporting, !3 = $displayErrors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   11     4        INIT_FCALL                                               'error_reporting'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                                 
   12     7        INIT_FCALL                                               'ini_set'
          8        SEND_VAL                                                 'display_errors'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                                 
   13    11        INIT_FCALL                                               'ini_set'
         12        SEND_VAL                                                 'log_errors'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                                 
   15    15        ECHO                                                     'error_reporting+%3D+'
         16        ECHO                                                     !2
         17        ECHO                                                     '%0A'
   16    18        ECHO                                                     'display_errors++%3D+'
         19        ECHO                                                     !3
         20        ECHO                                                     '%0A'
   17    21        ECHO                                                     'log_errors++++++%3D+'
         22        ECHO                                                     !3
         23        ECHO                                                     '%0A'
   19    24        INIT_FCALL                                               'error_clear_last'
         25        DO_ICALL                                                 
   20    26        INIT_FCALL                                               'highlight_string'
         27        SEND_VAR                                                 !0
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                                 
   21    30        ECHO                                                     'highlight_string%28%29%3A+'
   22    31        INIT_FCALL                                               'error_get_last'
         32        DO_ICALL                                         $9      
         33      > JMPZ                                                     $9, ->36
         34    >   QM_ASSIGN                                        ~10     'error'
         35      > JMP                                                      ->37
         36    >   QM_ASSIGN                                        ~10     'no+error'
         37    >   ECHO                                                     ~10
         38        ECHO                                                     '%0A'
   24    39        INIT_FCALL                                               'error_clear_last'
         40        DO_ICALL                                                 
   25    41        INIT_FCALL                                               'highlight_file'
         42        SEND_VAR                                                 !1
         43        SEND_VAL                                                 <true>
         44        DO_ICALL                                                 
   26    45        ECHO                                                     'highlight_file%28%29%3A+'
   27    46        INIT_FCALL                                               'error_get_last'
         47        DO_ICALL                                         $13     
         48      > JMPZ                                                     $13, ->51
         49    >   QM_ASSIGN                                        ~14     'error'
         50      > JMP                                                      ->52
         51    >   QM_ASSIGN                                        ~14     'no+error'
         52    >   ECHO                                                     ~14
         53        ECHO                                                     '%0A'
   28    54      > RETURN                                                   null

End of function examine

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.36 ms | 1407 KiB | 37 Q