3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fileHandle = fopen('php://memory', 'r+'); $string = '<?php class Foo { public function __construct($x) { $this->x = $x; } }'; rewind($fileHandle); fwrite($fileHandle, '$string'); include 'php://memory'; $test = new Foo(5);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AfhMe
function name:  (null)
number of ops:  19
compiled vars:  !0 = $fileHandle, !1 = $string, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 'php%3A%2F%2Fmemory'
          2        SEND_VAL                                                 'r%2B'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    5     5        ASSIGN                                                   !1, '%3C%3Fphp+class+Foo+%7B+public+function+__construct%28%24x%29+%7B+%24this-%3Ex+%3D+%24x%3B+%7D+%7D'
    6     6        INIT_FCALL                                               'rewind'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    7     9        INIT_FCALL                                               'fwrite'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '%24string'
         12        DO_ICALL                                                 
    9    13        INCLUDE_OR_EVAL                                          'php%3A%2F%2Fmemory', INCLUDE
   11    14        NEW                                              $9      'Foo'
         15        SEND_VAL_EX                                              5
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $9
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.96 ms | 1395 KiB | 19 Q