3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['apn' => 345345353, 'sqft' => 1121, 'address' => '12 Lincoln Ave.'], ['apn' => 345345351, 'sqft' => 1643, 'address' => '13 Lincoln Ave.'], ['apn' => 345345352, 'sqft' => 1222, 'address' => '14 Lincoln Ave.'], ['apn' => 345345358, 'sqft' => 1226, 'address' => '6 Olark Ave.'], ['apn' => 345345345, 'sqft' => 1200, 'address' => '323 Pacific Ave.'], ['apn' => 345345342, 'sqft' => 1421, 'address' => '324 Pacific Ave.'], ['apn' => 345345347, 'sqft' => 1093, 'address' => '328 Pacific Ave.'], ]; foreach ($array as $row) { [$number, $street] = explode(' ', $row['address'], 2); $group[$street][] = $number; } $result = []; foreach ($group as $street => $numbers) { if (sizeof($numbers) > 1) { array_push($result, min($numbers) . ' ' . $street, max($numbers) . ' ' . $street); } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 42
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 42
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 41
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 41
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 18
filename:       /in/2NaME
function name:  (null)
number of ops:  47
compiled vars:  !0 = $array, !1 = $row, !2 = $number, !3 = $street, !4 = $group, !5 = $result, !6 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1      > FE_RESET_R                                       $8      !0, ->18
          2    > > FE_FETCH_R                                               $8, !1, ->18
   13     3    >   INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '+'
          5        FETCH_DIM_R                                      ~9      !1, 'address'
          6        SEND_VAL                                                 ~9
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $10     
          9        FETCH_LIST_R                                     $11     $10, 0
         10        ASSIGN                                                   !2, $11
         11        FETCH_LIST_R                                     $13     $10, 1
         12        ASSIGN                                                   !3, $13
         13        FREE                                                     $10
   14    14        FETCH_DIM_W                                      $15     !4, !3
         15        ASSIGN_DIM                                               $15
         16        OP_DATA                                                  !2
   12    17      > JMP                                                      ->2
         18    >   FE_FREE                                                  $8
   17    19        ASSIGN                                                   !5, <array>
   18    20      > FE_RESET_R                                       $18     !4, ->42
         21    > > FE_FETCH_R                                       ~19     $18, !6, ->42
         22    >   ASSIGN                                                   !3, ~19
   19    23        COUNT                                            ~21     !6
         24        IS_SMALLER                                               1, ~21
         25      > JMPZ                                                     ~22, ->41
   20    26    >   INIT_FCALL                                               'array_push'
         27        SEND_REF                                                 !5
         28        INIT_FCALL                                               'min'
         29        SEND_VAR                                                 !6
         30        DO_ICALL                                         $23     
         31        CONCAT                                           ~24     $23, '+'
         32        CONCAT                                           ~25     ~24, !3
         33        SEND_VAL                                                 ~25
         34        INIT_FCALL                                               'max'
         35        SEND_VAR                                                 !6
         36        DO_ICALL                                         $26     
         37        CONCAT                                           ~27     $26, '+'
         38        CONCAT                                           ~28     ~27, !3
         39        SEND_VAL                                                 ~28
         40        DO_ICALL                                                 
   18    41    > > JMP                                                      ->21
         42    >   FE_FREE                                                  $18
   24    43        INIT_FCALL                                               'var_export'
         44        SEND_VAR                                                 !5
         45        DO_ICALL                                                 
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.46 ms | 1077 KiB | 18 Q