3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Heart{ public function Beat(){ echo 'bump bump'."\n"; } } class Animal{ protected $myVar; protected $heart; public function __construct() { $this->myVar = 'a'; $this->heart = new Heart(); } } class Cat extends Animal { public function foo() { echo $this->myVar."\n"; echo $this->heart."\n"; echo $this->heart->Beat(); } } $cat = new Cat(); $cat->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VXBFM
function name:  (null)
number of ops:  6
compiled vars:  !0 = $cat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'Cat'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Heart:
Function beat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VXBFM
function name:  Beat
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'bump+bump%0A'
    6     1      > RETURN                                                   null

End of function beat

End of class Heart.

Class Animal:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VXBFM
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN_OBJ                                               'myVar'
          1        OP_DATA                                                  'a'
   14     2        NEW                                              $2      'Heart'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'heart'
          5        OP_DATA                                                  $2
   15     6      > RETURN                                                   null

End of function __construct

End of class Animal.

Class Cat:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VXBFM
function name:  foo
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~0      'myVar'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   21     3        FETCH_OBJ_R                                      ~2      'heart'
          4        CONCAT                                           ~3      ~2, '%0A'
          5        ECHO                                                     ~3
   22     6        FETCH_OBJ_R                                      ~4      'heart'
          7        INIT_METHOD_CALL                                         ~4, 'Beat'
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
   23    10      > RETURN                                                   null

End of function foo

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VXBFM
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN_OBJ                                               'myVar'
          1        OP_DATA                                                  'a'
   14     2        NEW                                              $2      'Heart'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'heart'
          5        OP_DATA                                                  $2
   15     6      > RETURN                                                   null

End of function __construct

End of class Cat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.59 ms | 1390 KiB | 13 Q