3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $name; // private variable private $age; //private variable public function __construct() { $this->name = "a"; } } class B extends A { public function display($name, $age) { $this->name2 = $name; // new name2 variable, NOT A's name $this->age2 = $age; // new age2 variable, NOT A's age echo $this->name2." age is ".$this->age2.PHP_EOL; echo $this->name; } } $ob=new B(); $ob->display("xyz", 23);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJZU8
function name:  (null)
number of ops:  8
compiled vars:  !0 = $ob
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'display'
          4        SEND_VAL_EX                                              'xyz'
          5        SEND_VAL_EX                                              23
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function __construct

End of class A.

Class B:
Function display:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJZU8
function name:  display
number of ops:  15
compiled vars:  !0 = $name, !1 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ASSIGN_OBJ                                               'name2'
          3        OP_DATA                                                  !0
   16     4        ASSIGN_OBJ                                               'age2'
          5        OP_DATA                                                  !1
   17     6        FETCH_OBJ_R                                      ~4      'name2'
          7        CONCAT                                           ~5      ~4, '+age+is+'
          8        FETCH_OBJ_R                                      ~6      'age2'
          9        CONCAT                                           ~7      ~5, ~6
         10        CONCAT                                           ~8      ~7, '%0A'
         11        ECHO                                                     ~8
   18    12        FETCH_OBJ_R                                      ~9      'name'
         13        ECHO                                                     ~9
   19    14      > RETURN                                                   null

End of function display

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJZU8
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'name'
          1        OP_DATA                                                  'a'
   10     2      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.72 ms | 1008 KiB | 13 Q