3v4l.org

run code in 300+ PHP versions simultaneously
<?php class VariableStream { function stream_open($path, $mode, $options, &$opened_path) { return true; } function stream_read($count) { return "x"; } function stream_write($data) { return strlen($data); } function stream_tell() { return 0; } function stream_eof() { return true; } function stream_seek($offset, $whence) { return false; } function stream_metadata($path, $option, $var) { return true; } } stream_wrapper_register("var", "VariableStream") or die("Failed to register protocol"); chmod("var://myvar", 0777); /* $myvar = ""; $fp = fopen("var://myvar", "r+"); fwrite($fp, "line1\n"); fwrite($fp, "line2\n"); fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { echo fgets($fp); } fclose($fp); var_dump($myvar); */
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9fVWl
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   INIT_FCALL                                               'stream_wrapper_register'
          1        SEND_VAL                                                 'var'
          2        SEND_VAL                                                 'VariableStream'
          3        DO_ICALL                                         $0      
          4      > JMPNZ_EX                                         ~1      $0, ->7
          5    > > EXIT                                                     'Failed+to+register+protocol'
          6*       BOOL                                             ~1      <true>
   42     7    >   INIT_FCALL                                               'chmod'
          8        SEND_VAL                                                 'var%3A%2F%2Fmyvar'
          9        SEND_VAL                                                 511
         10        DO_ICALL                                                 
   58    11      > RETURN                                                   1

Class VariableStream:
Function stream_open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9fVWl
function name:  stream_open
number of ops:  6
compiled vars:  !0 = $path, !1 = $mode, !2 = $options, !3 = $opened_path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    6     4      > RETURN                                                   <true>
    7     5*     > RETURN                                                   null

End of function stream_open

Function stream_read:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9fVWl
function name:  stream_read
number of ops:  3
compiled vars:  !0 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1      > RETURN                                                   'x'
   12     2*     > RETURN                                                   null

End of function stream_read

Function stream_write:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9fVWl
function name:  stream_write
number of ops:  4
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        STRLEN                                           ~1      !0
          2      > RETURN                                                   ~1
   17     3*     > RETURN                                                   null

End of function stream_write

Function stream_tell:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9fVWl
function name:  stream_tell
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   0
   22     1*     > RETURN                                                   null

End of function stream_tell

Function stream_eof:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9fVWl
function name:  stream_eof
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E > > RETURN                                                   <true>
   27     1*     > RETURN                                                   null

End of function stream_eof

Function stream_seek:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9fVWl
function name:  stream_seek
number of ops:  4
compiled vars:  !0 = $offset, !1 = $whence
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   31     2      > RETURN                                                   <false>
   32     3*     > RETURN                                                   null

End of function stream_seek

Function stream_metadata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9fVWl
function name:  stream_metadata
number of ops:  5
compiled vars:  !0 = $path, !1 = $option, !2 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   36     3      > RETURN                                                   <true>
   37     4*     > RETURN                                                   null

End of function stream_metadata

End of class VariableStream.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.65 ms | 1400 KiB | 17 Q