3v4l.org

run code in 500+ PHP versions simultaneously
<?php // simulate a file from given string // return string fileName function virtualFile(string $content):string { return 'data://text/plain,'.urlencode($content); } $myString = "abc"; $fileName = virtualFile($myString); $myStringCopy = file_get_contents($fileName); //test var_dump($myString === $myStringCopy); //bool(true)
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8D7ak
function name:  (null)
number of ops:  14
compiled vars:  !0 = $myString, !1 = $fileName, !2 = $myStringCopy
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                       !0, 'abc'
   12     1        INIT_FCALL                                                   'virtualfile'
          2        SEND_VAR                                                     !0
          3        DO_FCALL                                          0  $4      
          4        ASSIGN                                                       !1, $4
   14     5        INIT_FCALL                                                   'file_get_contents'
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                             $6      
          8        ASSIGN                                                       !2, $6
   17     9        INIT_FCALL                                                   'var_dump'
         10        IS_IDENTICAL                                         ~8      !0, !2
         11        SEND_VAL                                                     ~8
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

Function virtualfile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8D7ak
function name:  virtualFile
number of ops:  9
compiled vars:  !0 = $content
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    7     1        INIT_FCALL                                                   'urlencode'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $1      
          4        CONCAT                                               ~2      'data%3A%2F%2Ftext%2Fplain%2C', $1
          5        VERIFY_RETURN_TYPE                                           ~2
          6      > RETURN                                                       ~2
    8     7*       VERIFY_RETURN_TYPE                                           
          8*     > RETURN                                                       null

End of function virtualfile

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.77 ms | 1854 KiB | 17 Q