3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(true && true){ echo 'dir='. __DIR__; } 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
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 2
Branch analysis from position: 1
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
filename:       /in/gDnHA
function name:  (null)
number of ops:  8
compiled vars:  !0 = $cat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     <true>, ->2
    4     1    >   ECHO                                                     'dir%3D%2Fin'
   32     2    >   NEW                                              $1      'Cat'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   33     5        INIT_METHOD_CALL                                         !0, 'foo'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class Heart:
Function beat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gDnHA
function name:  Beat
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'bump+bump%0A'
   10     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/gDnHA
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN_OBJ                                               'myVar'
          1        OP_DATA                                                  'a'
   18     2        NEW                                              $2      'Heart'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'heart'
          5        OP_DATA                                                  $2
   19     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/gDnHA
function name:  foo
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   FETCH_OBJ_R                                      ~0      'myVar'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   28     3        FETCH_OBJ_R                                      ~2      'heart'
          4        INIT_METHOD_CALL                                         ~2, 'Beat'
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
   29     7      > 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/gDnHA
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN_OBJ                                               'myVar'
          1        OP_DATA                                                  'a'
   18     2        NEW                                              $2      'Heart'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'heart'
          5        OP_DATA                                                  $2
   19     6      > RETURN                                                   null

End of function __construct

End of class Cat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.74 ms | 1399 KiB | 13 Q