3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a() { return [ 100 => 'first', 101 => 'second', 102 => 'third', 'named' => 'fourth', ]; } function b() { yield 100 => 'first'; yield 101 => 'second'; yield 102 => 'third'; yield 'named' => 'fourth'; } function c() { yield '100' => 'first'; yield '101' => 'second'; yield '102' => 'third'; yield 'named' => 'fourth'; } function test($x=null, $y=null, ...$z) { var_dump($x, $y, $z); } test(...a()); echo "\n"; test(...b()); echo "\n"; test(...c());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jOddJ
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'test'
          1        INIT_FCALL                                               'a'
          2        DO_FCALL                                      0  $0      
          3        SEND_UNPACK                                              $0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1          
   28     6        ECHO                                                     '%0A'
   29     7        INIT_FCALL                                               'test'
          8        INIT_FCALL                                               'b'
          9        DO_FCALL                                      0  $2      
         10        SEND_UNPACK                                              $2
         11        CHECK_UNDEF_ARGS                                         
         12        DO_FCALL                                      1          
   30    13        ECHO                                                     '%0A'
   31    14        INIT_FCALL                                               'test'
         15        INIT_FCALL                                               'c'
         16        DO_FCALL                                      0  $4      
         17        SEND_UNPACK                                              $4
         18        CHECK_UNDEF_ARGS                                         
         19        DO_FCALL                                      1          
         20      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jOddJ
function name:  a
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   <array>
   10     1*     > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/jOddJ
function name:  b
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   GENERATOR_CREATE                                         
   12     1        YIELD                                                    'first', 100
   13     2        YIELD                                                    'second', 101
   14     3        YIELD                                                    'third', 102
   15     4        YIELD                                                    'fourth', 'named'
   16     5      > GENERATOR_RETURN                                         

End of function b

Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/jOddJ
function name:  c
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   GENERATOR_CREATE                                         
   18     1        YIELD                                                    'first', '100'
   19     2        YIELD                                                    'second', '101'
   20     3        YIELD                                                    'third', '102'
   21     4        YIELD                                                    'fourth', 'named'
   22     5      > GENERATOR_RETURN                                         

End of function c

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jOddJ
function name:  test
number of ops:  9
compiled vars:  !0 = $x, !1 = $y, !2 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
          2        RECV_VARIADIC                                    !2      
   24     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                                 
   25     8      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.4 ms | 1012 KiB | 20 Q