3v4l.org

run code in 300+ 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 "encode - low-level - memory = " . stream_get_contents($stream) . PHP_EOL; $testString = 'test'; $stream = fopen('php://temp', 'r+'); fwrite($stream, $testString); rewind($stream); $filter = stream_filter_append($stream, 'convert.base64-encode'); echo "encode - low-level - temp = " . stream_get_contents($stream) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NnFV2
function name:  (null)
number of ops:  49
compiled vars:  !0 = $testString, !1 = $stream, !2 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'test'
    3     1        INIT_FCALL                                               'fopen'
          2        SEND_VAL                                                 'php%3A%2F%2Fmemory'
          3        SEND_VAL                                                 'r%2B'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    4     6        INIT_FCALL                                               'fwrite'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    5    10        INIT_FCALL                                               'rewind'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
    6    13        INIT_FCALL                                               'stream_filter_append'
         14        SEND_VAR                                                 !1
         15        SEND_VAL                                                 'convert.base64-encode'
         16        DO_ICALL                                         $8      
         17        ASSIGN                                                   !2, $8
    7    18        INIT_FCALL                                               'stream_get_contents'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $10     
         21        CONCAT                                           ~11     'encode+-+low-level+-+memory+%3D+', $10
         22        CONCAT                                           ~12     ~11, '%0A'
         23        ECHO                                                     ~12
    8    24        ASSIGN                                                   !0, 'test'
    9    25        INIT_FCALL                                               'fopen'
         26        SEND_VAL                                                 'php%3A%2F%2Ftemp'
         27        SEND_VAL                                                 'r%2B'
         28        DO_ICALL                                         $14     
         29        ASSIGN                                                   !1, $14
   10    30        INIT_FCALL                                               'fwrite'
         31        SEND_VAR                                                 !1
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                                 
   11    34        INIT_FCALL                                               'rewind'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
   12    37        INIT_FCALL                                               'stream_filter_append'
         38        SEND_VAR                                                 !1
         39        SEND_VAL                                                 'convert.base64-encode'
         40        DO_ICALL                                         $18     
         41        ASSIGN                                                   !2, $18
   13    42        INIT_FCALL                                               'stream_get_contents'
         43        SEND_VAR                                                 !1
         44        DO_ICALL                                         $20     
         45        CONCAT                                           ~21     'encode+-+low-level+-+temp+%3D+', $20
         46        CONCAT                                           ~22     ~21, '%0A'
         47        ECHO                                                     ~22
   14    48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.13 ms | 1400 KiB | 23 Q