3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', '1'); error_reporting(E_ALL); class _Parent { private $name = 'Parent'; public function doSomething() { return $this->name; } } class Child extends _Parent { private $name = 'Child'; public function doSomething() { return $this->name; } } class GrandChild extends Child { private $name = 'GrandChild'; public function doSomething() { return _Parent::doSomething() . ' from ' . $this->name; } } $parent = new _Parent(); $child = new Child(); $grandChild = new GrandChild(); echo $parent->doSomething() . PHP_EOL; echo $child->doSomething() . PHP_EOL; echo $grandChild->doSomething() . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PVq5O
function name:  (null)
number of ops:  29
compiled vars:  !0 = $parent, !1 = $child, !2 = $grandChild
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'display_errors'
          2        SEND_VAL                                                 '1'
          3        DO_ICALL                                                 
    3     4        INIT_FCALL                                               'error_reporting'
          5        SEND_VAL                                                 32767
          6        DO_ICALL                                                 
   29     7        NEW                                              $5      '_Parent'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $5
   30    10        NEW                                              $8      'Child'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $8
   31    13        NEW                                              $11     'GrandChild'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !2, $11
   33    16        INIT_METHOD_CALL                                         !0, 'doSomething'
         17        DO_FCALL                                      0  $14     
         18        CONCAT                                           ~15     $14, '%0A'
         19        ECHO                                                     ~15
   34    20        INIT_METHOD_CALL                                         !1, 'doSomething'
         21        DO_FCALL                                      0  $16     
         22        CONCAT                                           ~17     $16, '%0A'
         23        ECHO                                                     ~17
   35    24        INIT_METHOD_CALL                                         !2, 'doSomething'
         25        DO_FCALL                                      0  $18     
         26        CONCAT                                           ~19     $18, '%0A'
         27        ECHO                                                     ~19
         28      > RETURN                                                   1

Class _Parent:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PVq5O
function name:  doSomething
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function dosomething

End of class _Parent.

Class Child:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PVq5O
function name:  doSomething
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function dosomething

End of class Child.

Class GrandChild:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PVq5O
function name:  doSomething
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_STATIC_METHOD_CALL                                  '_Parent', 'doSomething'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '+from+'
          3        FETCH_OBJ_R                                      ~2      'name'
          4        CONCAT                                           ~3      ~1, ~2
          5      > RETURN                                                   ~3
   26     6*     > RETURN                                                   null

End of function dosomething

End of class GrandChild.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.33 ms | 1405 KiB | 17 Q