3v4l.org

run code in 300+ PHP versions simultaneously
<?php $socket = fopen('php://memory', 'a+'); fwrite($socket, 'ab'); fseek($socket, 0); fwrite($socket, 'a'); var_dump(fgets($socket));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2haHa
function name:  (null)
number of ops:  24
compiled vars:  !0 = $socket
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                                                 'a%2B'
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    4     5        INIT_FCALL                                               'fwrite'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 'ab'
          8        DO_ICALL                                                 
    5     9        INIT_FCALL                                               'fseek'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 0
         12        DO_ICALL                                                 
    7    13        INIT_FCALL                                               'fwrite'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 'a'
         16        DO_ICALL                                                 
    9    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'fgets'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $6      
         21        SEND_VAR                                                 $6
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.36 ms | 1395 KiB | 23 Q