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); $o = ''; if ($options & STREAM_USE_PATH) { $o .= ' STREAM_USE_PATH'; } if ($options & STREAM_IGNORE_URL) { $o .= ' STREAM_IGNORE_URL'; } if ($options & STREAM_ENFORCE_SAFE_MODE) { $o .= ' STREAM_ENFORCE_SAFE_MODE'; } if ($options & STREAM_REPORT_ERRORS) { $o .= ' STREAM_REPORT_ERRORS'; } if ($options & STREAM_MUST_SEEK) { $o .= ' STREAM_MUST_SEEK'; } exit($url['host'] . $url['path'] . "\n" . $mode . "\n" . ltrim($o)); //$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/LIH9b
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   INIT_FCALL                                               'stream_wrapper_register'
          1        SEND_VAL                                                 'steve'
          2        SEND_VAL                                                 'PosixStream'
          3        DO_ICALL                                                 
   63     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
   65     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
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 22
Branch analysis from position: 19
Branch analysis from position: 15
Branch analysis from position: 12
filename:       /in/LIH9b
function name:  stream_open
number of ops:  40
compiled vars:  !0 = $path, !1 = $mode, !2 = $options, !3 = $opened_path, !4 = $url, !5 = $o
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                                         $6      
          7        ASSIGN                                                   !4, $6
   12     8        ASSIGN                                                   !5, ''
   13     9        BW_AND                                           ~9      !2, 1
         10      > JMPZ                                                     ~9, ->12
   14    11    >   ASSIGN_OP                                     8          !5, '+STREAM_USE_PATH'
   16    12    >   BW_AND                                           ~11     !2, 2
         13      > JMPZ                                                     ~11, ->15
   17    14    >   ASSIGN_OP                                     8          !5, '+STREAM_IGNORE_URL'
   19    15    >   FETCH_CONSTANT                                   ~13     'STREAM_ENFORCE_SAFE_MODE'
         16        BW_AND                                           ~14     !2, ~13
         17      > JMPZ                                                     ~14, ->19
   20    18    >   ASSIGN_OP                                     8          !5, '+STREAM_ENFORCE_SAFE_MODE'
   22    19    >   BW_AND                                           ~16     !2, 8
         20      > JMPZ                                                     ~16, ->22
   23    21    >   ASSIGN_OP                                     8          !5, '+STREAM_REPORT_ERRORS'
   25    22    >   BW_AND                                           ~18     !2, 16
         23      > JMPZ                                                     ~18, ->25
   26    24    >   ASSIGN_OP                                     8          !5, '+STREAM_MUST_SEEK'
   28    25    >   FETCH_DIM_R                                      ~20     !4, 'host'
         26        FETCH_DIM_R                                      ~21     !4, 'path'
         27        CONCAT                                           ~22     ~20, ~21
         28        CONCAT                                           ~23     ~22, '%0A'
         29        CONCAT                                           ~24     ~23, !1
         30        CONCAT                                           ~25     ~24, '%0A'
         31        INIT_FCALL                                               'ltrim'
         32        SEND_VAR                                                 !5
         33        DO_ICALL                                         $26     
         34        CONCAT                                           ~27     ~25, $26
         35      > EXIT                                                     ~27
   31    36*       INIT_FCALL                                               'fopen'
         37*       DO_ICALL                                                 
   32    38*       RETURN                                                   <true>
   33    39*     > 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/LIH9b
function name:  stream_read
number of ops:  3
compiled vars:  !0 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   36     1      > RETURN                                                   ''
   37     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/LIH9b
function name:  stream_write
number of ops:  3
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
   40     1      > RETURN                                                   0
   41     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/LIH9b
function name:  stream_tell
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E > > RETURN                                                   0
   45     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/LIH9b
function name:  stream_eof
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     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/LIH9b
function name:  stream_seek
number of ops:  4
compiled vars:  !0 = $offset, !1 = $whence
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <const ast>
   52     2      > RETURN                                                   <false>
   53     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/LIH9b
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
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   56     3        CONCAT                                           ~3      !0, '%0A'
          4        CONCAT                                           ~4      ~3, !1
          5        CONCAT                                           ~5      ~4, '%0A'
          6        CONCAT                                           ~6      ~5, !2
          7      > EXIT                                                     ~6
   57     8*       RETURN                                                   <false>
   58     9*     > RETURN                                                   null

End of function stream_metadata

End of class PosixStream.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.57 ms | 1404 KiB | 23 Q