3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class bob{ public $myitem; function __contruct(){ $myitem = 25; } //public function GetItem(){ //return $this->$myitem; //} } class john extends bob{ public function GetItem(){ //echo parent::GetItem(); echo parent->$myitem; } } $j = new john(); $j->GetItem();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uWalH
function name:  (null)
number of ops:  6
compiled vars:  !0 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'john'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     3        INIT_METHOD_CALL                                         !0, 'GetItem'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class bob:
Function __contruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uWalH
function name:  __contruct
number of ops:  2
compiled vars:  !0 = $myitem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 25
    7     1      > RETURN                                                   null

End of function __contruct

End of class bob.

Class john:
Function getitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uWalH
function name:  GetItem
number of ops:  4
compiled vars:  !0 = $myitem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   FETCH_CONSTANT                                   ~1      'parent'
          1        FETCH_OBJ_R                                      ~2      ~1, !0
          2        ECHO                                                     ~2
   23     3      > RETURN                                                   null

End of function getitem

Function __contruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uWalH
function name:  __contruct
number of ops:  2
compiled vars:  !0 = $myitem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 25
    7     1      > RETURN                                                   null

End of function __contruct

End of class john.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.67 ms | 1394 KiB | 13 Q