3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $message = 'breaks'; public function __construct() { } public function getMessage() { return $this->message; } } class B extends A { public function __construct($message) { parent::__construct(); $this->message = $message; } } $o = new B('works'); echo $o->getMessage() . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EUjMR
function name:  (null)
number of ops:  9
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'B'
          1        SEND_VAL_EX                                              'works'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   23     4        INIT_METHOD_CALL                                         !0, 'getMessage'
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      $4, '%0A'
          7        ECHO                                                     ~5
          8      > RETURN                                                   1

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

End of function __construct

Function getmessage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EUjMR
function name:  getMessage
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'message'
          1      > RETURN                                                   ~0
   12     2*     > RETURN                                                   null

End of function getmessage

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/EUjMR
function name:  __construct
number of ops:  6
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_STATIC_METHOD_CALL                                  
          2        DO_FCALL                                      0          
   18     3        ASSIGN_OBJ                                               'message'
          4        OP_DATA                                                  !0
   19     5      > RETURN                                                   null

End of function __construct

Function getmessage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EUjMR
function name:  getMessage
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'message'
          1      > RETURN                                                   ~0
   12     2*     > RETURN                                                   null

End of function getmessage

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.12 ms | 1399 KiB | 14 Q