3v4l.org

run code in 300+ PHP versions simultaneously
<?php class File { // "Resource(stream)" isn't all that useful private $fp; // But all the stream meta data is public function __debugInfo() { return $this->fp ? stream_get_meta_data($fp) : []; } public function open($filename, $mode = 'r'){ $this->fp = fopen($filename, $mode); } } $f = new File; var_dump($f); // object(File)#1 { } $f->open('http://php.net'); var_dump($f); /* object(File)#1 { ["wrapper_type"]=> string(4) "http" ["stream_type"]=> string(10) "tcp_socket" etc... */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rjI78
function name:  (null)
number of ops:  13
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'File'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   18     6        INIT_METHOD_CALL                                         !0, 'open'
          7        SEND_VAL_EX                                              'http%3A%2F%2Fphp.net'
          8        DO_FCALL                                      0          
   19     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   27    12      > RETURN                                                   1

Class File:
Function __debuginfo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rjI78
function name:  __debugInfo
number of ops:  10
compiled vars:  !0 = $fp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~1      'fp'
          1      > JMPZ                                                     ~1, ->7
          2    >   INIT_FCALL                                               'stream_get_meta_data'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        QM_ASSIGN                                        ~3      $2
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~3      <array>
          8    > > RETURN                                                   ~3
    9     9*     > RETURN                                                   null

End of function __debuginfo

Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rjI78
function name:  open
number of ops:  9
compiled vars:  !0 = $filename, !1 = $mode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'r'
   12     2        INIT_FCALL                                               'fopen'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6        ASSIGN_OBJ                                               'fp'
          7        OP_DATA                                                  $3
   13     8      > RETURN                                                   null

End of function open

End of class File.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.72 ms | 1400 KiB | 19 Q