3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $foo = 1; public function getFoo() { return $this->foo; } } class B extends A { public $foo = 2; } var_dump((new A)->getFoo(), (new B)->getFoo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lTHfX
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'A'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'getFoo'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        NEW                                              $3      'B'
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $3, 'getFoo'
          9        DO_FCALL                                      0  $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function getfoo

End of class A.

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

End of function getfoo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.04 ms | 998 KiB | 14 Q