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) { exit($path . "\n" . $mode . "\n" . $options . "\n" . $opened_path); //$this->host = parse_url($path, PHP_URL_HOST); //$this->fileHandle = 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/8lPBp
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   INIT_FCALL                                               'stream_wrapper_register'
          1        SEND_VAL                                                 'steve'
          2        SEND_VAL                                                 'PosixStream'
          3        DO_ICALL                                                 
   45     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
   47     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/8lPBp
function name:  stream_open
number of ops:  13
compiled vars:  !0 = $path, !1 = $mode, !2 = $options, !3 = $opened_path
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        CONCAT                                           ~4      !0, '%0A'
          5        CONCAT                                           ~5      ~4, !1
          6        CONCAT                                           ~6      ~5, '%0A'
          7        CONCAT                                           ~7      ~6, !2
          8        CONCAT                                           ~8      ~7, '%0A'
          9        CONCAT                                           ~9      ~8, !3
         10      > EXIT                                                     ~9
   14    11*       RETURN                                                   <true>
   15    12*     > 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/8lPBp
function name:  stream_read
number of ops:  3
compiled vars:  !0 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1      > RETURN                                                   ''
   19     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/8lPBp
function name:  stream_write
number of ops:  3
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1      > RETURN                                                   0
   23     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/8lPBp
function name:  stream_tell
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E > > RETURN                                                   0
   27     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/8lPBp
function name:  stream_eof
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     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/8lPBp
function name:  stream_seek
number of ops:  4
compiled vars:  !0 = $offset, !1 = $whence
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <const ast>
   34     2      > RETURN                                                   <false>
   35     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/8lPBp
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
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   38     3        CONCAT                                           ~3      !0, '%0A'
          4        CONCAT                                           ~4      ~3, !1
          5        CONCAT                                           ~5      ~4, '%0A'
          6        CONCAT                                           ~6      ~5, !2
          7      > EXIT                                                     ~6
   39     8*       RETURN                                                   <false>
   40     9*     > RETURN                                                   null

End of function stream_metadata

End of class PosixStream.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.88 ms | 1404 KiB | 19 Q