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 "encode - low-level - memory = " . stream_get_contents($stream) . PHP_EOL; $testString = 'dGVzdA=='; $stream = fopen('php://memory', 'r+'); fwrite($stream, $testString); rewind($stream); $filter = stream_filter_append($stream, 'convert.base64-decode'); echo "decode - 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; $testString = 'dGVzdA=='; $stream = fopen('php://temp', 'r+'); fwrite($stream, $testString); rewind($stream); $filter = stream_filter_append($stream, 'convert.base64-decode'); echo "decode - 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/HFW1e
function name:  (null)
number of ops:  97
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
    9    24        ASSIGN                                                       !0, 'dGVzdA%3D%3D'
   10    25        INIT_FCALL                                                   'fopen'
         26        SEND_VAL                                                     'php%3A%2F%2Fmemory'
         27        SEND_VAL                                                     'r%2B'
         28        DO_ICALL                                             $14     
         29        ASSIGN                                                       !1, $14
   11    30        INIT_FCALL                                                   'fwrite'
         31        SEND_VAR                                                     !1
         32        SEND_VAR                                                     !0
         33        DO_ICALL                                                     
   12    34        INIT_FCALL                                                   'rewind'
         35        SEND_VAR                                                     !1
         36        DO_ICALL                                                     
   13    37        INIT_FCALL                                                   'stream_filter_append'
         38        SEND_VAR                                                     !1
         39        SEND_VAL                                                     'convert.base64-decode'
         40        DO_ICALL                                             $18     
         41        ASSIGN                                                       !2, $18
   14    42        INIT_FCALL                                                   'stream_get_contents'
         43        SEND_VAR                                                     !1
         44        DO_ICALL                                             $20     
         45        CONCAT                                               ~21     'decode+-+low-level+-+memory+%3D+', $20
         46        CONCAT                                               ~22     ~21, '%0A'
         47        ECHO                                                         ~22
   16    48        ASSIGN                                                       !0, 'test'
   17    49        INIT_FCALL                                                   'fopen'
         50        SEND_VAL                                                     'php%3A%2F%2Ftemp'
         51        SEND_VAL                                                     'r%2B'
         52        DO_ICALL                                             $24     
         53        ASSIGN                                                       !1, $24
   18    54        INIT_FCALL                                                   'fwrite'
         55        SEND_VAR                                                     !1
         56        SEND_VAR                                                     !0
         57        DO_ICALL                                                     
   19    58        INIT_FCALL                                                   'rewind'
         59        SEND_VAR                                                     !1
         60        DO_ICALL                                                     
   20    61        INIT_FCALL                                                   'stream_filter_append'
         62        SEND_VAR                                                     !1
         63        SEND_VAL                                                     'convert.base64-encode'
         64        DO_ICALL                                             $28     
         65        ASSIGN                                                       !2, $28
   21    66        INIT_FCALL                                                   'stream_get_contents'
         67        SEND_VAR                                                     !1
         68        DO_ICALL                                             $30     
         69        CONCAT                                               ~31     'encode+-+low-level+-+temp+%3D+', $30
         70        CONCAT                                               ~32     ~31, '%0A'
         71        ECHO                                                         ~32
   23    72        ASSIGN                                                       !0, 'dGVzdA%3D%3D'
   24    73        INIT_FCALL                                                   'fopen'
         74        SEND_VAL                                                     'php%3A%2F%2Ftemp'
         75        SEND_VAL                                                     'r%2B'
         76        DO_ICALL                                             $34     
         77        ASSIGN                                                       !1, $34
   25    78        INIT_FCALL                                                   'fwrite'
         79        SEND_VAR                                                     !1
         80        SEND_VAR                                                     !0
         81        DO_ICALL                                                     
   26    82        INIT_FCALL                                                   'rewind'
         83        SEND_VAR                                                     !1
         84        DO_ICALL                                                     
   27    85        INIT_FCALL                                                   'stream_filter_append'
         86        SEND_VAR                                                     !1
         87        SEND_VAL                                                     'convert.base64-decode'
         88        DO_ICALL                                             $38     
         89        ASSIGN                                                       !2, $38
   28    90        INIT_FCALL                                                   'stream_get_contents'
         91        SEND_VAR                                                     !1
         92        DO_ICALL                                             $40     
         93        CONCAT                                               ~41     'decode+-+low-level+-+temp+%3D+', $40
         94        CONCAT                                               ~42     ~41, '%0A'
         95        ECHO                                                         ~42
   29    96      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.39 ms | 2289 KiB | 18 Q