3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Beer { const NAME = 'Beer!'; public static function printed(){ echo 'static Beer:NAME = '. static::NAME . PHP_EOL; } } class Ale extends Beer { const NAME = 'Ale!'; public static function printed(){ forward_static_call(array('parent','printed')); call_user_func(array('parent','printed')); forward_static_call(array(parent::class,'printed')); call_user_func(array(parent::class,'printed')); forward_static_call(array('Beer','printed')); call_user_func(array('Beer','printed')); } } Ale::printed();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GjlEk
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'Ale', 'printed'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class Beer:
Function printed:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GjlEk
function name:  printed
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_CLASS_CONSTANT                             ~0      'NAME'
          1        CONCAT                                           ~1      'static+Beer%3ANAME+%3D+', ~0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    7     4      > RETURN                                                   null

End of function printed

End of class Beer.

Class Ale:
Function printed:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GjlEk
function name:  printed
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'forward_static_call'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                                 
   14     3        INIT_USER_CALL                                0          'call_user_func', <array>
          4        DO_FCALL                                      0          
   16     5        INIT_FCALL                                               'forward_static_call'
          6        SEND_VAL                                                 <array>
          7        DO_ICALL                                                 
   17     8        INIT_USER_CALL                                0          'call_user_func', <array>
          9        DO_FCALL                                      0          
   19    10        INIT_FCALL                                               'forward_static_call'
         11        SEND_VAL                                                 <array>
         12        DO_ICALL                                                 
   20    13        INIT_USER_CALL                                0          'call_user_func', <array>
         14        DO_FCALL                                      0          
   21    15      > RETURN                                                   null

End of function printed

End of class Ale.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.19 ms | 1396 KiB | 15 Q