3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $property; public function __construct() { $this->property = 'hello'; } } class A_Decorator { private $a; public function __construct($a) { $this->a = $a; } public function access() { echo $this->a->property; } } $a = new A; $a_dec = new A_Decorator($a); $a_dec->access();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JBbr7
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a, !1 = $a_dec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        NEW                                              $5      'A_Decorator'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   18     7        INIT_METHOD_CALL                                         !1, 'access'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function __construct

End of class A.

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

End of function __construct

Function access:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JBbr7
function name:  access
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'a'
          1        FETCH_OBJ_R                                      ~1      ~0, 'property'
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function access

End of class A_Decorator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.94 ms | 1395 KiB | 13 Q