3v4l.org

run code in 300+ PHP versions simultaneously
<?php function couple($items) { $a = array(); for ($i = 0, $n = count($items); $i < $n; $i++) for ($j = $i + 1; $j < $n; $j++) $a[] = array($items[$j], $items[$i]); return $a; } var_dump(couple(array(1,2,3))) ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMR4s
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'couple'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   12     6      > RETURN                                                   1

Function couple:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 6
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 6
Branch analysis from position: 21
Branch analysis from position: 6
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
Branch analysis from position: 9
filename:       /in/qMR4s
function name:  couple
number of ops:  23
compiled vars:  !0 = $items, !1 = $a, !2 = $i, !3 = $n, !4 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 0
          3        COUNT                                            ~7      !0
          4        ASSIGN                                                   !3, ~7
          5      > JMP                                                      ->19
    6     6    >   ADD                                              ~9      !2, 1
          7        ASSIGN                                                   !4, ~9
          8      > JMP                                                      ->16
    7     9    >   FETCH_DIM_R                                      ~12     !0, !4
         10        INIT_ARRAY                                       ~13     ~12
         11        FETCH_DIM_R                                      ~14     !0, !2
         12        ADD_ARRAY_ELEMENT                                ~13     ~14
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  ~13
    6    15        PRE_INC                                                  !4
         16    >   IS_SMALLER                                               !4, !3
         17      > JMPNZ                                                    ~16, ->9
    5    18    >   PRE_INC                                                  !2
         19    >   IS_SMALLER                                               !2, !3
         20      > JMPNZ                                                    ~18, ->6
    8    21    > > RETURN                                                   !1
    9    22*     > RETURN                                                   null

End of function couple

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.75 ms | 1399 KiB | 16 Q