3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test2 { public function getSomething() { return "something"; } } class Test1 { private $test2; public function __construct($test2) { $this->test2=$test2; } public function getTest2() { return $this->_test2; } } $test1=new Test1(new Test2()); echo $test1->getTest2()->getSomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cbgdv
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Test1'
          1        NEW                                              $2      'Test2'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   23     6        INIT_METHOD_CALL                                         !0, 'getTest2'
          7        DO_FCALL                                      0  $6      
          8        INIT_METHOD_CALL                                         $6, 'getSomething'
          9        DO_FCALL                                      0  $7      
         10        ECHO                                                     $7
         11      > RETURN                                                   1

Class Test2:
Function getsomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cbgdv
function name:  getSomething
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'something'
    6     1*     > RETURN                                                   null

End of function getsomething

End of class Test2.

Class Test1:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cbgdv
function name:  __construct
number of ops:  4
compiled vars:  !0 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               'test2'
          2        OP_DATA                                                  !0
   14     3      > RETURN                                                   null

End of function __construct

Function gettest2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cbgdv
function name:  getTest2
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      '_test2'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function gettest2

End of class Test1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.54 ms | 1395 KiB | 13 Q