3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function test($bar, $baz = null) { var_dump(func_get_args()); } } class Baz extends Foo { public static function test($bar, ...$args) { parent::test($bar, ...$args); } } Baz::test(1); Baz::test(2, 'hello');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YCmPS
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'Baz', 'test'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0          
   16     3        INIT_STATIC_METHOD_CALL                                  'Baz', 'test'
          4        SEND_VAL                                                 2
          5        SEND_VAL                                                 'hello'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YCmPS
function name:  test
number of ops:  7
compiled vars:  !0 = $bar, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    5     2        INIT_FCALL                                               'var_dump'
          3        FUNC_GET_ARGS                                    ~2      
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
    6     6      > RETURN                                                   null

End of function test

End of class Foo.

Class Baz:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YCmPS
function name:  test
number of ops:  8
compiled vars:  !0 = $bar, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
   11     2        INIT_STATIC_METHOD_CALL                                  'test'
          3        SEND_VAR_EX                                              !0
          4        SEND_UNPACK                                              !1
          5        CHECK_UNDEF_ARGS                                         
          6        DO_FCALL                                      1          
   12     7      > RETURN                                                   null

End of function test

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.77 ms | 1396 KiB | 15 Q