3v4l.org

run code in 500+ PHP versions simultaneously
<?php $testString = 'test'; $stream = fopen('php://memory','r+'); fwrite($stream, $testString); rewind($stream); $filter = stream_filter_append($stream, 'convert.base64-encode'); echo "memoryStream = " . stream_get_contents($stream).PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jr2Mi
function name:  (null)
number of ops:  25
compiled vars:  !0 = $testString, !1 = $stream, !2 = $filter
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'test'
    4     1        INIT_FCALL                                                   'fopen'
          2        SEND_VAL                                                     'php%3A%2F%2Fmemory'
          3        SEND_VAL                                                     'r%2B'
          4        DO_ICALL                                             $4      
          5        ASSIGN                                                       !1, $4
    5     6        INIT_FCALL                                                   'fwrite'
          7        SEND_VAR                                                     !1
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                                     
    6    10        INIT_FCALL                                                   'rewind'
         11        SEND_VAR                                                     !1
         12        DO_ICALL                                                     
    7    13        INIT_FCALL                                                   'stream_filter_append'
         14        SEND_VAR                                                     !1
         15        SEND_VAL                                                     'convert.base64-encode'
         16        DO_ICALL                                             $8      
         17        ASSIGN                                                       !2, $8
    8    18        INIT_FCALL                                                   'stream_get_contents'
         19        SEND_VAR                                                     !1
         20        DO_ICALL                                             $10     
         21        CONCAT                                               ~11     'memoryStream+%3D+', $10
         22        CONCAT                                               ~12     ~11, '%0A'
         23        ECHO                                                         ~12
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.4 ms | 3318 KiB | 18 Q