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 { const NAME = 'Ale!'; public static function printed(){ forward_static_call(array('Beer','printed')); call_user_func(array('Beer','printed')); } } Ale::printed(); echo '</pre>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B2V9I
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'Ale', 'printed'
          1        DO_FCALL                                      0          
   18     2        ECHO                                                     '%3C%2Fpre%3E'
          3      > RETURN                                                   1

Class Beer:
Function printed:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B2V9I
function name:  printed
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_CLASS_CONSTANT                             ~0      'NAME'
          1        CONCAT                                           ~1      'static+Beer%3ANAME+%3D+', ~0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    6     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/B2V9I
function name:  printed
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'forward_static_call'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                                 
   13     3        INIT_USER_CALL                                0          'call_user_func', <array>
          4        DO_FCALL                                      0          
   14     5      > RETURN                                                   null

End of function printed

End of class Ale.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.63 ms | 1395 KiB | 15 Q