3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function (int $no, string $msg) { if (str_starts_with($msg, 'Creation of dynamic property ')) { return true; } elseif (preg_match('~^file_get_contents\(cust\d+://x\): Failed to open stream: ~', $msg)) { return true; } return false; }); $classes = get_declared_classes(); $testedClasses = 0; $i = 0; foreach ($classes as $class) { $scheme = 'cust' . ++$i; // var_dump($class); try { stream_wrapper_register($scheme, $class); file_get_contents($scheme . '://x'); } catch (\Throwable $e) { continue; } $testedClasses++; } if ($testedClasses === 0) { print "Did not test any class\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 27
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 27
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 27
Found catch point at position: 23
Branch analysis from position: 23
2 jumps found. (Code = 107) Position 1 = 24, Position 2 = -2
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
filename:       /in/sR5ZB
function name:  (null)
number of ops:  32
compiled vars:  !0 = $classes, !1 = $testedClasses, !2 = $i, !3 = $class, !4 = $scheme, !5 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
   11     2        SEND_VAL                                                 ~6
    3     3        DO_ICALL                                                 
   13     4        INIT_FCALL                                               'get_declared_classes'
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !0, $8
   14     7        ASSIGN                                                   !1, 0
   16     8        ASSIGN                                                   !2, 0
   17     9      > FE_RESET_R                                       $12     !0, ->27
         10    > > FE_FETCH_R                                               $12, !3, ->27
   18    11    >   PRE_INC                                          ~13     !2
         12        CONCAT                                           ~14     'cust', ~13
         13        ASSIGN                                                   !4, ~14
   21    14        INIT_FCALL                                               'stream_wrapper_register'
         15        SEND_VAR                                                 !4
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
   22    18        INIT_FCALL                                               'file_get_contents'
         19        CONCAT                                           ~17     !4, '%3A%2F%2Fx'
         20        SEND_VAL                                                 ~17
         21        DO_ICALL                                                 
         22      > JMP                                                      ->25
   23    23  E > > CATCH                                       last         'Throwable'
   24    24    > > JMP                                                      ->10
   26    25    >   PRE_INC                                                  !1
   17    26      > JMP                                                      ->10
         27    >   FE_FREE                                                  $12
   29    28        IS_IDENTICAL                                             !1, 0
         29      > JMPZ                                                     ~20, ->31
   30    30    >   ECHO                                                     'Did+not+test+any+class%0A'
   31    31    > > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sR5ZB
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $no, !1 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'str_starts_with'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 'Creation+of+dynamic+property+'
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->9
    5     7    > > RETURN                                                   <true>
    4     8*       JMP                                                      ->15
    6     9    >   INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%7E%5Efile_get_contents%5C%28cust%5Cd%2B%3A%2F%2Fx%5C%29%3A+Failed+to+open+stream%3A+%7E'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $3      
         13      > JMPZ                                                     $3, ->15
    7    14    > > RETURN                                                   <true>
   10    15    > > RETURN                                                   <false>
   11    16*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.75 ms | 1021 KiB | 19 Q