3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a = 'a'; private $b = 'a'; public function __get($key) { return $this->$key; } } class B extends A { private $a = 'b'; public function __get($key) { return $this->$key; } } $a = new A(); echo $a->a; echo $a->b; $b = new B(); echo $b->a; echo $b->b;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CR4ol
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        FETCH_OBJ_R                                      ~5      !0, 'a'
          4        ECHO                                                     ~5
   26     5        FETCH_OBJ_R                                      ~6      !0, 'b'
          6        ECHO                                                     ~6
   28     7        NEW                                              $7      'B'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   29    10        FETCH_OBJ_R                                      ~10     !1, 'a'
         11        ECHO                                                     ~10
   30    12        FETCH_OBJ_R                                      ~11     !1, 'b'
         13        ECHO                                                     ~11
   31    14      > RETURN                                                   1

Class A:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CR4ol
function name:  __get
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   11     3*     > RETURN                                                   null

End of function __get

End of class A.

Class B:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CR4ol
function name:  __get
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   21     3*     > RETURN                                                   null

End of function __get

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.78 ms | 1395 KiB | 13 Q