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('Beer','printed')); call_user_func(array('Beer','printed')); } public static function yeah() { echo 'yeah!'.PHP_EOL; } } Ale::printed(); echo 'ASDASD'. PHP_EOL; $asd = new Ale(); call_user_func($asd, 'yeah');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C7IQa
function name:  (null)
number of ops:  10
compiled vars:  !0 = $asd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'Ale', 'printed'
          1        DO_FCALL                                      0          
   25     2        ECHO                                                     'ASDASD%0A'
   26     3        NEW                                              $2      'Ale'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   27     6        INIT_USER_CALL                                1          'call_user_func', !0
          7        SEND_USER                                                'yeah'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Beer:
Function printed:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C7IQa
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/C7IQa
function name:  printed
number of ops:  11
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          
   18    10      > RETURN                                                   null

End of function printed

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

End of function yeah

End of class Ale.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.84 ms | 1400 KiB | 15 Q