3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [[2,48],[48,2],[19,31],[31,19]]; $result = []; foreach ($array as $row) { sort($row); $result[json_encode($row)] ??= $row; } var_export(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/n4HXYL
function name:  (null)
number of ops:  28
compiled vars:  !0 = $array, !1 = $result, !2 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        ASSIGN                                                       !1, <array>
    6     2      > FE_RESET_R                                           $5      !0, ->20
          3    > > FE_FETCH_R                                                   $5, !2, ->20
    7     4    >   INIT_FCALL                                                   'sort'
          5        SEND_REF                                                     !2
          6        DO_ICALL                                                     
    8     7        INIT_FCALL                                                   'json_encode'
          8        SEND_VAR                                                     !2
          9        DO_ICALL                                             $7      
         10        COPY_TMP                                             $8      $7
         11        FETCH_DIM_IS                                         ~9      !1, $7
         12        COALESCE                                             ~10     ~9
         13        ASSIGN_DIM                                           ~11     !1, $8
         14        OP_DATA                                                      !2
         15        QM_ASSIGN                                            ~10     ~11
         16      > JMP                                                          ->18
         17*       FREE                                                         $8
         18    >   FREE                                                         ~10
    6    19      > JMP                                                          ->3
         20    >   FE_FREE                                                      $5
   10    21        INIT_FCALL                                                   'var_export'
         22        INIT_FCALL                                                   'array_values'
         23        SEND_VAR                                                     !1
         24        DO_ICALL                                             $12     
         25        SEND_VAR                                                     $12
         26        DO_ICALL                                                     
         27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
145.97 ms | 1905 KiB | 17 Q