3v4l.org

run code in 300+ PHP versions simultaneously
<?php function permutation(array $arr) { while($ele=array_shift($arr)) { $row=array($ele); foreach($arr as $rest) { $row[]=$rest; } if(count($row)==2) var_dump($row); } } permutation(array("1","2","3","4"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75IdB
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'permutation'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function permutation:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 2
Branch analysis from position: 21
Branch analysis from position: 2
Branch analysis from position: 16
Branch analysis from position: 9
filename:       /in/75IdB
function name:  permutation
number of ops:  22
compiled vars:  !0 = $arr, !1 = $row, !2 = $ele, !3 = $rest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1      > JMP                                                      ->16
    6     2    >   INIT_ARRAY                                       ~4      !2
          3        ASSIGN                                                   !1, ~4
    8     4      > FE_RESET_R                                       $6      !0, ->9
          5    > > FE_FETCH_R                                               $6, !3, ->9
   10     6    >   ASSIGN_DIM                                               !1
          7        OP_DATA                                                  !3
    8     8      > JMP                                                      ->5
          9    >   FE_FREE                                                  $6
   14    10        COUNT                                            ~8      !1
         11        IS_EQUAL                                                 ~8, 2
         12      > JMPZ                                                     ~9, ->16
         13    >   INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
    4    16    >   INIT_FCALL                                               'array_shift'
         17        SEND_REF                                                 !0
         18        DO_ICALL                                         $11     
         19        ASSIGN                                           ~12     !2, $11
         20      > JMPNZ                                                    ~12, ->2
   16    21    > > RETURN                                                   null

End of function permutation

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.94 ms | 1403 KiB | 18 Q