3v4l.org

run code in 300+ PHP versions simultaneously
<?php class dogtag { public $Words; } class dog { public $Name; public $DogTag; public function bark() { print "Woof!\n"; } public function __construct($DogName) { print "Creating $DogName\n"; $this->Name = $DogName; $this->DogTag = new dogtag; $this->DogTag->Words = "My name is $DogName. If you find me, please call 555-1234"; } } class poodle extends dog { public function bark() { print "Yip!\n"; } } $poppy = new poodle("Poppy"); print $poppy->DogTag->Words . "\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O3hTR
function name:  (null)
number of ops:  9
compiled vars:  !0 = $poppy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $1      'poodle'
          1        SEND_VAL_EX                                              'Poppy'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   29     4        FETCH_OBJ_R                                      ~4      !0, 'DogTag'
          5        FETCH_OBJ_R                                      ~5      ~4, 'Words'
          6        CONCAT                                           ~6      ~5, '%0A'
          7        ECHO                                                     ~6
   30     8      > RETURN                                                   1

Class dogtag: [no user functions]
Class dog:
Function bark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O3hTR
function name:  bark
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'Woof%21%0A'
   12     1      > RETURN                                                   null

End of function bark

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O3hTR
function name:  __construct
number of ops:  18
compiled vars:  !0 = $DogName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ROPE_INIT                                     3  ~2      'Creating+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
   16     5        ASSIGN_OBJ                                               'Name'
          6        OP_DATA                                                  !0
   17     7        NEW                                              $6      'dogtag'
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               'DogTag'
         10        OP_DATA                                                  $6
   18    11        ROPE_INIT                                     3  ~11     'My+name+is+'
         12        ROPE_ADD                                      1  ~11     ~11, !0
         13        ROPE_END                                      2  ~10     ~11, '.+If+you+find+me%2C+please+call+555-1234'
         14        FETCH_OBJ_W                                      $8      'DogTag'
         15        ASSIGN_OBJ                                               $8, 'Words'
         16        OP_DATA                                                  ~10
   19    17      > RETURN                                                   null

End of function __construct

End of class dog.

Class poodle:
Function bark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O3hTR
function name:  bark
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ECHO                                                     'Yip%21%0A'
   25     1      > RETURN                                                   null

End of function bark

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O3hTR
function name:  __construct
number of ops:  18
compiled vars:  !0 = $DogName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ROPE_INIT                                     3  ~2      'Creating+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
   16     5        ASSIGN_OBJ                                               'Name'
          6        OP_DATA                                                  !0
   17     7        NEW                                              $6      'dogtag'
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               'DogTag'
         10        OP_DATA                                                  $6
   18    11        ROPE_INIT                                     3  ~11     'My+name+is+'
         12        ROPE_ADD                                      1  ~11     ~11, !0
         13        ROPE_END                                      2  ~10     ~11, '.+If+you+find+me%2C+please+call+555-1234'
         14        FETCH_OBJ_W                                      $8      'DogTag'
         15        ASSIGN_OBJ                                               $8, 'Words'
         16        OP_DATA                                                  ~10
   19    17      > RETURN                                                   null

End of function __construct

End of class poodle.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.95 ms | 1399 KiB | 13 Q