3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [5, true, 'FooBar'], [8, true, 'Bar'], [18, true, 'IsTied'], ]; $result = []; $longest = 0; foreach ($array as $row) { $len = strlen($row[2]); if ($len >= $longest) { $longest = $len; $result[$len][] = $row; } } var_export($result[$longest] ?? []);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/Jd9jN
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $result, !2 = $longest, !3 = $row, !4 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   10     2        ASSIGN                                                   !2, 0
   11     3      > FE_RESET_R                                       $8      !0, ->15
          4    > > FE_FETCH_R                                               $8, !3, ->15
   12     5    >   FETCH_DIM_R                                      ~9      !3, 2
          6        STRLEN                                           ~10     ~9
          7        ASSIGN                                                   !4, ~10
   13     8        IS_SMALLER_OR_EQUAL                                      !2, !4
          9      > JMPZ                                                     ~12, ->14
   14    10    >   ASSIGN                                                   !2, !4
   15    11        FETCH_DIM_W                                      $14     !1, !4
         12        ASSIGN_DIM                                               $14
         13        OP_DATA                                                  !3
   11    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $8
   18    16        INIT_FCALL                                               'var_export'
         17        FETCH_DIM_IS                                     ~16     !1, !2
         18        COALESCE                                         ~17     ~16
         19        QM_ASSIGN                                        ~17     <array>
         20        SEND_VAL                                                 ~17
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.21 ms | 1000 KiB | 14 Q