3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo($a, ...$arg) { print_r(func_get_args()); print_r($arg); print_r($a); } function goo(...$arg) { print_r(func_get_args()); print_r($arg); } foo(...[ 'b' => 2, 'a' => 1,'d' => 3]); print PHP_EOL; print PHP_EOL; goo(...[ 'b' => 2, 'a' => 1,'d' => 3]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2U6E4
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                                   'foo'
          1        SEND_UNPACK                                                  <array>
          2        CHECK_UNDEF_ARGS                                             
          3        DO_FCALL                                          1          
   15     4        ECHO                                                         '%0A'
   16     5        ECHO                                                         '%0A'
   17     6        INIT_FCALL                                                   'goo'
          7        SEND_UNPACK                                                  <array>
          8        CHECK_UNDEF_ARGS                                             
          9        DO_FCALL                                          1          
         10      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2U6E4
function name:  foo
number of ops:  13
compiled vars:  !0 = $a, !1 = $arg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV_VARIADIC                                        !1      
    4     2        INIT_FCALL                                                   'print_r'
          3        FUNC_GET_ARGS                                        ~2      
          4        SEND_VAL                                                     ~2
          5        DO_ICALL                                                     
    5     6        INIT_FCALL                                                   'print_r'
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                                     
    6     9        INIT_FCALL                                                   'print_r'
         10        SEND_VAR                                                     !0
         11        DO_ICALL                                                     
    7    12      > RETURN                                                       null

End of function foo

Function goo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2U6E4
function name:  goo
number of ops:  9
compiled vars:  !0 = $arg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV_VARIADIC                                        !0      
   10     1        INIT_FCALL                                                   'print_r'
          2        FUNC_GET_ARGS                                        ~1      
          3        SEND_VAL                                                     ~1
          4        DO_ICALL                                                     
   11     5        INIT_FCALL                                                   'print_r'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                                     
   12     8      > RETURN                                                       null

End of function goo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.43 ms | 1484 KiB | 16 Q