3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class bob{ function __contruct(){ $myitem = 25; } public function GetItem(){ return $myitem; } var $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/9WXb1
function name:  (null)
number of ops:  6
compiled vars:  !0 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'john'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     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/9WXb1
function name:  __contruct
number of ops:  2
compiled vars:  !0 = $myitem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 25
    5     1      > RETURN                                                   null

End of function __contruct

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

End of function getitem

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/9WXb1
function name:  GetItem
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'GetItem'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   20     3        FETCH_STATIC_PROP_R          unknown             ~1      'myitem'
          4        ECHO                                                     ~1
   21     5      > 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/9WXb1
function name:  __contruct
number of ops:  2
compiled vars:  !0 = $myitem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 25
    5     1      > RETURN                                                   null

End of function __contruct

End of class john.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.41 ms | 1395 KiB | 13 Q