3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Beer { const NAME = 'Beer!'; public function getName() { return static::NAME; } } class Ale extends Beer { const NAME = 'Ale!'; } $beerDrink = new Beer; $aleDrink = new Ale; echo "Beer is: " . $beerDrink->getName() ."\n"; echo "Ale is: " . $aleDrink->getName() ."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8BI2k
function name:  (null)
number of ops:  17
compiled vars:  !0 = $beerDrink, !1 = $aleDrink
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'Beer'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        NEW                                              $5      'Ale'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   15     6        INIT_METHOD_CALL                                         !0, 'getName'
          7        DO_FCALL                                      0  $8      
          8        CONCAT                                           ~9      'Beer+is%3A+', $8
          9        CONCAT                                           ~10     ~9, '%0A'
         10        ECHO                                                     ~10
   16    11        INIT_METHOD_CALL                                         !1, 'getName'
         12        DO_FCALL                                      0  $11     
         13        CONCAT                                           ~12     'Ale+is%3A++', $11
         14        CONCAT                                           ~13     ~12, '%0A'
         15        ECHO                                                     ~13
         16      > RETURN                                                   1

Class Beer:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8BI2k
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_CLASS_CONSTANT                             ~0      'NAME'
          1      > RETURN                                                   ~0
    6     2*     > RETURN                                                   null

End of function getname

End of class Beer.

Class Ale:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8BI2k
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_CLASS_CONSTANT                             ~0      'NAME'
          1      > RETURN                                                   ~0
    6     2*     > RETURN                                                   null

End of function getname

End of class Ale.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.19 ms | 1399 KiB | 13 Q