3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $x; public function __construct() { $this->x = 1; } public function hi() { return __METHOD__ . ': x = ' . $x; } } class B extends A { public function __construct() { $this->x = 2; } } $b = new B(); echo $b->hi();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C2n3J
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'hi'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

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

End of function __construct

Function hi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C2n3J
function name:  hi
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   CONCAT                                           ~1      'A%3A%3Ahi%3A+x+%3D+', !0
          1      > RETURN                                                   ~1
   10     2*     > RETURN                                                   null

End of function hi

End of class A.

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

End of function __construct

Function hi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C2n3J
function name:  hi
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   CONCAT                                           ~1      'A%3A%3Ahi%3A+x+%3D+', !0
          1      > RETURN                                                   ~1
   10     2*     > RETURN                                                   null

End of function hi

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.88 ms | 1395 KiB | 13 Q