3v4l.org

run code in 300+ PHP versions simultaneously
<?php function zeroOneTwo($one, $two, $three) { return [$one, $two, $three]; } function abc($b, $c, $a) { return [$a, $b, $c]; } $numericKeyedArray = [4,5,6]; var_export(abc(...$numericKeyedArray)); echo "\n---\n"; var_export(zeroOneTwo(...$numericKeyedArray)); echo "\n===\n"; $nonNumericKeyedArray = ['c' => 'sea', 'a' => 'A', 'b' => 'bee']; echo "\n---\n"; var_export(abc(...$nonNumericKeyedArray)); echo "\n===\n"; var_export(zeroOneTwo(...$nonNumericKeyedArray));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NYufH
function name:  (null)
number of ops:  35
compiled vars:  !0 = $numericKeyedArray, !1 = $nonNumericKeyedArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'abc'
          3        SEND_UNPACK                                              !0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1  $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
   13     8        ECHO                                                     '%0A---%0A'
   14     9        INIT_FCALL                                               'var_export'
         10        INIT_FCALL                                               'zeroonetwo'
         11        SEND_UNPACK                                              !0
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      1  $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                                 
   15    16        ECHO                                                     '%0A%3D%3D%3D%0A'
   17    17        ASSIGN                                                   !1, <array>
   18    18        ECHO                                                     '%0A---%0A'
   19    19        INIT_FCALL                                               'var_export'
         20        INIT_FCALL                                               'abc'
         21        SEND_UNPACK                                              !1
         22        CHECK_UNDEF_ARGS                                         
         23        DO_FCALL                                      1  $8      
         24        SEND_VAR                                                 $8
         25        DO_ICALL                                                 
   20    26        ECHO                                                     '%0A%3D%3D%3D%0A'
   21    27        INIT_FCALL                                               'var_export'
         28        INIT_FCALL                                               'zeroonetwo'
         29        SEND_UNPACK                                              !1
         30        CHECK_UNDEF_ARGS                                         
         31        DO_FCALL                                      1  $10     
         32        SEND_VAR                                                 $10
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Function zeroonetwo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NYufH
function name:  zeroOneTwo
number of ops:  8
compiled vars:  !0 = $one, !1 = $two, !2 = $three
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        INIT_ARRAY                                       ~3      !0
          4        ADD_ARRAY_ELEMENT                                ~3      !1
          5        ADD_ARRAY_ELEMENT                                ~3      !2
          6      > RETURN                                                   ~3
    5     7*     > RETURN                                                   null

End of function zeroonetwo

Function abc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NYufH
function name:  abc
number of ops:  8
compiled vars:  !0 = $b, !1 = $c, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    8     3        INIT_ARRAY                                       ~3      !2
          4        ADD_ARRAY_ELEMENT                                ~3      !0
          5        ADD_ARRAY_ELEMENT                                ~3      !1
          6      > RETURN                                                   ~3
    9     7*     > RETURN                                                   null

End of function abc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.35 ms | 1009 KiB | 18 Q