3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { const NAME = 'A'; public static function test() { $args = func_get_args( 'more', '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')); 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/8TjAT
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/8TjAT
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/8TjAT
function name:  test
number of ops:  15
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'func_get_args'
          1        SEND_VAL                                                 'more'
          2        SEND_VAL                                                 'args'
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    8     5        FETCH_CLASS_CONSTANT                             ~3      'NAME'
          6        ECHO                                                     ~3
          7        INIT_FCALL                                               'join'
          8        SEND_VAL                                                 '%2C'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        CONCAT                                           ~5      '+', $4
         12        CONCAT                                           ~6      ~5, '+%0A'
         13        ECHO                                                     ~6
    9    14      > 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/8TjAT
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'
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                                 
   19     5        INIT_FCALL                                               'forward_static_call'
          6        SEND_VAL                                                 'test'
          7        SEND_VAL                                                 'other'
          8        SEND_VAL                                                 'args'
          9        DO_ICALL                                                 
   20    10      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
215.94 ms | 1400 KiB | 19 Q