3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo (iterable $ints) { $actualInts = []; foreach ($ints as $int) { $actualInts[] = (function (int $int): int { return $int; })($int); } return $actualInts; } function bar (iterable $ints) { $actualInts = (function (int ... $ints): array { return $ints; })(... array_values(is_array($ints) ? $ints : iterator_to_array($ints))); return $actualInts; } function getIt(): Generator { yield '1'; yield 3; } var_dump(foo(['1', 3])); var_dump(foo(getIt())); var_dump(bar(['1', 3])); var_dump(bar(getIt()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ebRjE
function name:  (null)
number of ops:  29
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'foo'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   29     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'foo'
          8        INIT_FCALL                                               'getit'
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_FCALL                                      0  $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                                 
   30    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'bar'
         16        SEND_VAL                                                 <array>
         17        DO_FCALL                                      0  $5      
         18        SEND_VAR                                                 $5
         19        DO_ICALL                                                 
   31    20        INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'bar'
         22        INIT_FCALL                                               'getit'
         23        DO_FCALL                                      0  $7      
         24        SEND_VAR                                                 $7
         25        DO_FCALL                                      0  $8      
         26        SEND_VAR                                                 $8
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/ebRjE
function name:  foo
number of ops:  14
compiled vars:  !0 = $ints, !1 = $actualInts, !2 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $4      !0, ->11
          3    > > FE_FETCH_R                                               $4, !2, ->11
    7     4    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FebRjE%3A7%240'
    9     5        INIT_DYNAMIC_CALL                                        ~6
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0  $7      
    7     8        ASSIGN_DIM                                               !1
    9     9        OP_DATA                                                  $7
    6    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $4
   12    12      > RETURN                                                   !1
   13    13*     > RETURN                                                   null

End of function foo

Function %00%7Bclosure%7D%2Fin%2FebRjE%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ebRjE
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        VERIFY_RETURN_TYPE                                       !0
          2      > RETURN                                                   !0
    9     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FebRjE%3A7%240

Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ebRjE
function name:  bar
number of ops:  20
compiled vars:  !0 = $ints, !1 = $actualInts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FebRjE%3A16%241'
   18     2        INIT_DYNAMIC_CALL                                        ~2
          3        INIT_FCALL                                               'array_values'
          4        TYPE_CHECK                                  128          !0
          5      > JMPZ                                                     ~3, ->8
          6    >   QM_ASSIGN                                        ~4      !0
          7      > JMP                                                      ->12
          8    >   INIT_FCALL                                               'iterator_to_array'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        QM_ASSIGN                                        ~4      $5
         12    >   SEND_VAL                                                 ~4
         13        DO_ICALL                                         $6      
         14        SEND_UNPACK                                              $6
         15        CHECK_UNDEF_ARGS                                         
         16        DO_FCALL                                      1  $7      
   16    17        ASSIGN                                                   !1, $7
   20    18      > RETURN                                                   !1
   21    19*     > RETURN                                                   null

End of function bar

Function %00%7Bclosure%7D%2Fin%2FebRjE%3A16%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ebRjE
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $ints
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV_VARIADIC                                    !0      
   17     1        VERIFY_RETURN_TYPE                                       !0
          2      > RETURN                                                   !0
   18     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FebRjE%3A16%241

Function getit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/ebRjE
function name:  getIt
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   GENERATOR_CREATE                                         
   24     1        YIELD                                                    '1'
   25     2        YIELD                                                    3
   26     3      > GENERATOR_RETURN                                         

End of function getit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
213.17 ms | 1407 KiB | 25 Q