3v4l.org

run code in 500+ 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 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sR5ZB
function name:  {closure:/in/sR5ZB:3}
number of ops:  11
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        FRAMELESS_ICALL_2                str_starts_with      ~2      !1, 'Creation+of+dynamic+property+'
          3      > JMPZ                                                         ~2, ->6
    5     4    > > RETURN                                                       <true>
    4     5*       JMP                                                          ->9
    6     6    >   FRAMELESS_ICALL_2                preg_match          ~3      '%7E%5Efile_get_contents%5C%28cust%5Cd%2B%3A%2F%2Fx%5C%29%3A+Failed+to+open+stream%3A+%7E', !1
          7      > JMPZ                                                         ~3, ->9
    7     8    > > RETURN                                                       <true>
   10     9    > > RETURN                                                       <false>
   11    10*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.83 ms | 486 KiB | 11 Q