3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StreamWrapper { public function stream_open( string $path, string $mode, int $options, ?string &$opened_path = null ): bool { var_dump(__METHOD__, func_get_args()); return true; } public function stream_write(string $data) { var_dump(__METHOD__, func_get_args()); return strlen($data); } public function stream_close(): void { var_dump(__METHOD__); } } stream_wrapper_register('test', StreamWrapper::class); $fp = fopen('test://foo', 'w'); fwrite($fp, str_repeat('a', 9 * 1024)); fclose($fp);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RiENn
function name:  (null)
number of ops:  21
compiled vars:  !0 = $fp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'stream_wrapper_register'
          1        SEND_VAL                                                 'test'
          2        SEND_VAL                                                 'StreamWrapper'
          3        DO_ICALL                                                 
   29     4        INIT_FCALL                                               'fopen'
          5        SEND_VAL                                                 'test%3A%2F%2Ffoo'
          6        SEND_VAL                                                 'w'
          7        DO_ICALL                                         $2      
          8        ASSIGN                                                   !0, $2
   30     9        INIT_FCALL                                               'fwrite'
         10        SEND_VAR                                                 !0
         11        INIT_FCALL                                               'str_repeat'
         12        SEND_VAL                                                 'a'
         13        SEND_VAL                                                 9216
         14        DO_ICALL                                         $4      
         15        SEND_VAR                                                 $4
         16        DO_ICALL                                                 
   31    17        INIT_FCALL                                               'fclose'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class StreamWrapper:
Function stream_open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RiENn
function name:  stream_open
number of ops:  12
compiled vars:  !0 = $path, !1 = $mode, !2 = $options, !3 = $opened_path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
   11     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAL                                                 'StreamWrapper%3A%3Astream_open'
          6        FUNC_GET_ARGS                                    ~4      
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                                 
   12     9      > RETURN                                                   <true>
   13    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function stream_open

Function stream_write:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RiENn
function name:  stream_write
number of ops:  9
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'StreamWrapper%3A%3Astream_write'
          3        FUNC_GET_ARGS                                    ~1      
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   18     6        STRLEN                                           ~3      !0
          7      > RETURN                                                   ~3
   19     8*     > RETURN                                                   null

End of function stream_write

Function stream_close:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RiENn
function name:  stream_close
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'StreamWrapper%3A%3Astream_close'
          2        DO_ICALL                                                 
   24     3      > RETURN                                                   null

End of function stream_close

End of class StreamWrapper.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.84 ms | 1400 KiB | 25 Q