3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { const NAME = 'A'; public static function test() { $args = func_get_args(); echo static::NAME, " ".join(',', $args)." \n"; } } class B extends A { const NAME = 'B'; public static function test() { echo self::NAME, "\n"; forward_static_call_array(array('A', 'test'), array('more', 'args')); forward_static_call_array( 'test', array('other', 'args')); } } B::test('foo'); function test() { $args = func_get_args(); echo "C ".join(',', $args)." \n"; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RPAHG
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   INIT_STATIC_METHOD_CALL                                      'B', 'test'
          1        SEND_VAL                                                     'foo'
          2        DO_FCALL                                          0          
   30     3      > RETURN                                                       1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RPAHG
function name:  test
number of ops:  10
compiled vars:  !0 = $args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   FUNC_GET_ARGS                                        ~1      
          1        ASSIGN                                                       !0, ~1
   27     2        INIT_FCALL                                                   'join'
          3        SEND_VAL                                                     '%2C'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $3      
          6        CONCAT                                               ~4      'C+', $3
          7        CONCAT                                               ~5      ~4, '+%0A'
          8        ECHO                                                         ~5
   28     9      > RETURN                                                       null

End of function test

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RPAHG
function name:  test
number of ops:  12
compiled vars:  !0 = $args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   FUNC_GET_ARGS                                        ~1      
          1        ASSIGN                                                       !0, ~1
    8     2        FETCH_CLASS_CONSTANT                                 ~3      'NAME'
          3        ECHO                                                         ~3
          4        INIT_FCALL                                                   'join'
          5        SEND_VAL                                                     '%2C'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $4      
          8        CONCAT                                               ~5      '+', $4
          9        CONCAT                                               ~6      ~5, '+%0A'
         10        ECHO                                                         ~6
    9    11      > RETURN                                                       null

End of function test

End of class A.

Class B:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RPAHG
function name:  test
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   ECHO                                                         'B'
          1        ECHO                                                         '%0A'
   18     2        INIT_FCALL                                                   'forward_static_call_array'
          3        SEND_VAL                                                     <array>
          4        SEND_VAL                                                     <array>
          5        DO_ICALL                                                     
   19     6        INIT_FCALL                                                   'forward_static_call_array'
          7        SEND_VAL                                                     'test'
          8        SEND_VAL                                                     <array>
          9        DO_ICALL                                                     
   20    10      > RETURN                                                       null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.5 ms | 2540 KiB | 14 Q