3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a() { yield 0 => 'first'; yield 0 => 'second'; } function b() { yield 0 => 'first'; yield '0' => 'second'; } function c() { yield '0' => 'first'; yield '0' => 'second'; } function test(...$args) { var_dump($args); } 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/qNMep
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     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          
   20     6        ECHO                                                     '%0A'
   21     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          
   22    13        ECHO                                                     '%0A'
   23    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 = 161) Position 1 = -2
filename:       /in/qNMep
function name:  a
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        YIELD                                                    'first', 0
    5     2        YIELD                                                    'second', 0
    6     3      > GENERATOR_RETURN                                         

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/qNMep
function name:  b
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   GENERATOR_CREATE                                         
    8     1        YIELD                                                    'first', 0
    9     2        YIELD                                                    'second', '0'
   10     3      > 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/qNMep
function name:  c
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   GENERATOR_CREATE                                         
   12     1        YIELD                                                    'first', '0'
   13     2        YIELD                                                    'second', '0'
   14     3      > 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/qNMep
function name:  test
number of ops:  5
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_VARIADIC                                    !0      
   16     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   17     4      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.74 ms | 1012 KiB | 20 Q