3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $str = 'Foo'; public function getStr() { return $this->str; } } function f_obj($a) { echo $a->getStr(); var_dump($a); } function f_str($a) { echo $a; var_dump($a); } $a = new A(); var_dump($a); f_obj($a); f_str($a->getStr());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rZueP
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   26     6        INIT_FCALL                                               'f_obj'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0          
   27     9        INIT_FCALL                                               'f_str'
         10        INIT_METHOD_CALL                                         !0, 'getStr'
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Function f_obj:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rZueP
function name:  f_obj
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_METHOD_CALL                                         !0, 'getStr'
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
   14     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   15     7      > RETURN                                                   null

End of function f_obj

Function f_str:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rZueP
function name:  f_str
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        ECHO                                                     !0
   19     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   20     5      > RETURN                                                   null

End of function f_str

Class A:
Function getstr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rZueP
function name:  getStr
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'str'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function getstr

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.48 ms | 1403 KiB | 17 Q