3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PosixStream { private $fileHandle = null; private $host; private $position = 0; public function stream_open($path, $mode, $options, &$opened_path) { $url = parse_url($path); exit($url['host'] . $url['path'] . "\n" . $mode . "\n" . $options . "\n" . $opened_path); //$this->host = parse_url($path, PHP_URL_HOST); //$this->fileHandle = fopen($); fopen(); return true; } public function stream_read($count) { return ''; } public function stream_write($data) { return 0; } public function stream_tell() { return 0; } public function stream_eof() { true; } public function stream_seek($offset, $whence = SEEK_SET) { return false; } public function stream_metadata($path, $option, $value) { exit($path . "\n" . $option . "\n" . $value); return false; } } stream_wrapper_register('steve', 'PosixStream'); $test = fopen('steve://t/e/test.txt', 'r+'); fclose($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RAiUA
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   INIT_FCALL                                               'stream_wrapper_register'
          1        SEND_VAL                                                 'steve'
          2        SEND_VAL                                                 'PosixStream'
          3        DO_ICALL                                                 
   47     4        INIT_FCALL                                               'fopen'
          5        SEND_VAL                                                 'steve%3A%2F%2Ft%2Fe%2Ftest.txt'
          6        SEND_VAL                                                 'r%2B'
          7        DO_ICALL                                         $2      
          8        ASSIGN                                                   !0, $2
   49     9        INIT_FCALL                                               'fclose'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class PosixStream:
Function stream_open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/RAiUA
function name:  stream_open
number of ops:  22
compiled vars:  !0 = $path, !1 = $mode, !2 = $options, !3 = $opened_path, !4 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   11     4        INIT_FCALL                                               'parse_url'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !4, $5
   12     8        FETCH_DIM_R                                      ~7      !4, 'host'
          9        FETCH_DIM_R                                      ~8      !4, 'path'
         10        CONCAT                                           ~9      ~7, ~8
         11        CONCAT                                           ~10     ~9, '%0A'
         12        CONCAT                                           ~11     ~10, !1
         13        CONCAT                                           ~12     ~11, '%0A'
         14        CONCAT                                           ~13     ~12, !2
         15        CONCAT                                           ~14     ~13, '%0A'
         16        CONCAT                                           ~15     ~14, !3
         17      > EXIT                                                     ~15
   15    18*       INIT_FCALL                                               'fopen'
         19*       DO_ICALL                                                 
   16    20*       RETURN                                                   <true>
   17    21*     > 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/RAiUA
function name:  stream_read
number of ops:  3
compiled vars:  !0 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1      > RETURN                                                   ''
   21     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/RAiUA
function name:  stream_write
number of ops:  3
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1      > RETURN                                                   0
   25     2*     > 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/RAiUA
function name:  stream_tell
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                   0
   29     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/RAiUA
function name:  stream_eof
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E > > 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/RAiUA
function name:  stream_seek
number of ops:  4
compiled vars:  !0 = $offset, !1 = $whence
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <const ast>
   36     2      > RETURN                                                   <false>
   37     3*     > RETURN                                                   null

End of function stream_seek

Function stream_metadata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/RAiUA
function name:  stream_metadata
number of ops:  10
compiled vars:  !0 = $path, !1 = $option, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   40     3        CONCAT                                           ~3      !0, '%0A'
          4        CONCAT                                           ~4      ~3, !1
          5        CONCAT                                           ~5      ~4, '%0A'
          6        CONCAT                                           ~6      ~5, !2
          7      > EXIT                                                     ~6
   41     8*       RETURN                                                   <false>
   42     9*     > RETURN                                                   null

End of function stream_metadata

End of class PosixStream.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.49 ms | 1404 KiB | 21 Q