3v4l.org

run code in 300+ 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('A', 'test'), 'more', 'args'); forward_static_call( 'test', 'other', 'args'); } } B::test(); 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/hpLKr
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'test'
          1        DO_FCALL                                      0          
   30     2      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hpLKr
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/hpLKr
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/hpLKr
function name:  test
number of ops:  13
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'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 'more'
          5        SEND_VAL                                                 'args'
          6        DO_ICALL                                                 
   19     7        INIT_FCALL                                               'forward_static_call'
          8        SEND_VAL                                                 'test'
          9        SEND_VAL                                                 'other'
         10        SEND_VAL                                                 'args'
         11        DO_ICALL                                                 
   20    12      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.98 ms | 1392 KiB | 17 Q