3v4l.org

run code in 300+ PHP versions simultaneously
<?php $base = sys_get_temp_dir() . '/gh10232-base'; if (!is_dir($base)) { mkdir($base) or die; } $files = [ 'gh10232.php' => <<<'END' <?php set_include_path('gh10232-nonexistent') or exit(1); chdir(__DIR__) or exit(1); spl_autoload_register(function () { trigger_error(__LINE__); $ex = new Exception(); echo 'Exception on line ', $ex->getLine(), "\n"; require_once __DIR__ . '/gh10232/constant_def.inc'; }, true); class ConstantRef { public const VALUE = ConstantDef::VALUE; } ConstantRef::VALUE; END, 'gh10232/constant_def.inc' => <<<'END' <?php trigger_error(basename(__FILE__)); $ex = new Exception(); echo 'Exception in ', basename($ex->getFile()), ' on line ', $ex->getLine(), "\n"; require_once 'required.inc'; // The script of the same directory. class ConstantDef { const VALUE = true; } END, 'gh10232/required.inc' => <<<'END' <?php trigger_error(basename(__FILE__)); $ex = new Exception(); echo 'Exception in ', basename($ex->getFile()), ' on line ', $ex->getLine(), "\n"; END, ]; foreach ($files as $path => $content) { $path = $base . '/' . $path; if (!is_dir(dirname($path))) { mkdir(dirname($path)); } file_put_contents($path, $content); } require_once $base . '/' . (function_exists('array_key_first') ? array_key_first($files) : key($files));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 47) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 41
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 41
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 36
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 36
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 52
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 15
filename:       /in/v4nl0
function name:  (null)
number of ops:  59
compiled vars:  !0 = $base, !1 = $files, !2 = $content, !3 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'sys_get_temp_dir'
          1        DO_ICALL                                         $4      
          2        CONCAT                                           ~5      $4, '%2Fgh10232-base'
          3        ASSIGN                                                   !0, ~5
    5     4        INIT_FCALL                                               'is_dir'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $7      
          7        BOOL_NOT                                         ~8      $7
          8      > JMPZ                                                     ~8, ->15
    6     9    >   INIT_FCALL                                               'mkdir'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $9      
         12      > JMPNZ_EX                                         ~10     $9, ->15
         13    > > EXIT                                                     
         14*       BOOL                                             ~10     <true>
    9    15    >   ASSIGN                                                   !1, <array>
   54    16      > FE_RESET_R                                       $12     !1, ->41
         17    > > FE_FETCH_R                                       ~13     $12, !2, ->41
         18    >   ASSIGN                                                   !3, ~13
   55    19        CONCAT                                           ~15     !0, '%2F'
         20        CONCAT                                           ~16     ~15, !3
         21        ASSIGN                                                   !3, ~16
   56    22        INIT_FCALL                                               'is_dir'
         23        INIT_FCALL                                               'dirname'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                         $18     
         26        SEND_VAR                                                 $18
         27        DO_ICALL                                         $19     
         28        BOOL_NOT                                         ~20     $19
         29      > JMPZ                                                     ~20, ->36
   57    30    >   INIT_FCALL                                               'mkdir'
         31        INIT_FCALL                                               'dirname'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                         $21     
         34        SEND_VAR                                                 $21
         35        DO_ICALL                                                 
   59    36    >   INIT_FCALL                                               'file_put_contents'
         37        SEND_VAR                                                 !3
         38        SEND_VAR                                                 !2
         39        DO_ICALL                                                 
   54    40      > JMP                                                      ->17
         41    >   FE_FREE                                                  $12
   62    42        CONCAT                                           ~24     !0, '%2F'
         43        INIT_FCALL                                               'function_exists'
         44        SEND_VAL                                                 'array_key_first'
         45        DO_ICALL                                         $25     
         46      > JMPZ                                                     $25, ->52
         47    >   INIT_FCALL                                               'array_key_first'
         48        SEND_VAR                                                 !1
         49        DO_ICALL                                         $26     
         50        QM_ASSIGN                                        ~27     $26
         51      > JMP                                                      ->56
         52    >   INIT_FCALL                                               'key'
         53        SEND_VAR                                                 !1
         54        DO_ICALL                                         $28     
         55        QM_ASSIGN                                        ~27     $28
         56    >   CONCAT                                           ~29     ~24, ~27
         57        INCLUDE_OR_EVAL                                          ~29, REQUIRE_ONCE
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.49 ms | 1018 KiB | 21 Q