3v4l.org

run code in 300+ PHP versions simultaneously
<?php $socket = fopen('php://memory', 'a+'); fwrite($socket, implode('', array_map('json_encode', [ ['a'=>'b'], ['b' => 'c'] ]))); fseek($socket, 0); fwrite($socket, json_encode(['x'=>'y'])); var_dump(fgets($socket));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fMq6Z
function name:  (null)
number of ops:  35
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        INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 ''
          9        INIT_FCALL                                               'array_map'
         10        SEND_VAL                                                 'json_encode'
         11        SEND_VAL                                                 <array>
         12        DO_ICALL                                         $3      
         13        SEND_VAR                                                 $3
         14        DO_ICALL                                         $4      
         15        SEND_VAR                                                 $4
         16        DO_ICALL                                                 
    5    17        INIT_FCALL                                               'fseek'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 0
         20        DO_ICALL                                                 
    7    21        INIT_FCALL                                               'fwrite'
         22        SEND_VAR                                                 !0
         23        INIT_FCALL                                               'json_encode'
         24        SEND_VAL                                                 <array>
         25        DO_ICALL                                         $7      
         26        SEND_VAR                                                 $7
         27        DO_ICALL                                                 
    9    28        INIT_FCALL                                               'var_dump'
         29        INIT_FCALL                                               'fgets'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $9      
         32        SEND_VAR                                                 $9
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.24 ms | 1401 KiB | 29 Q