3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $test; public function setTest($value) { $this->test = $value; return $this; } public function getPrivatePropertyOfAnotherOject(A $obj) { return $obj->test; } } $a = (new A())->setTest('x'); var_dump((new A())->getPrivatePropertyOfAnotherOject($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v6gkF
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'setTest'
          3        SEND_VAL_EX                                              'x'
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !0, $3
   21     6        INIT_FCALL                                               'var_dump'
          7        NEW                                              $5      'A'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $5, 'getPrivatePropertyOfAnotherOject'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class A:
Function settest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v6gkF
function name:  setTest
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'test'
          2        OP_DATA                                                  !0
   10     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   11     5*     > RETURN                                                   null

End of function settest

Function getprivatepropertyofanotheroject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v6gkF
function name:  getPrivatePropertyOfAnotherOject
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        FETCH_OBJ_R                                      ~1      !0, 'test'
          2      > RETURN                                                   ~1
   16     3*     > RETURN                                                   null

End of function getprivatepropertyofanotheroject

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.71 ms | 1396 KiB | 15 Q