3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'company 1' => [1981 => 1, 1945 => 3], 'company 2' => [1990 => 18, 2005 => 13], 'company 3' => [1950 => 6, 2012 => 9] ]; $minYear = 9999; $maxYear = 0; foreach ($array as $row) { foreach ($row as $year => $value) { if ($year > $maxYear) { $maxYear = $year; } if ($year < $minYear) { $minYear = $year; } } } echo "MinYear = $minYear, MaxYear = $maxYear";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
Branch analysis from position: 11
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/ljgqK
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $minYear, !2 = $maxYear, !3 = $row, !4 = $value, !5 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 9999
   10     2        ASSIGN                                                   !2, 0
   11     3      > FE_RESET_R                                       $9      !0, ->17
          4    > > FE_FETCH_R                                               $9, !3, ->17
   12     5    > > FE_RESET_R                                       $10     !3, ->15
          6    > > FE_FETCH_R                                       ~11     $10, !4, ->15
          7    >   ASSIGN                                                   !5, ~11
   13     8        IS_SMALLER                                               !2, !5
          9      > JMPZ                                                     ~13, ->11
   14    10    >   ASSIGN                                                   !2, !5
   16    11    >   IS_SMALLER                                               !5, !1
         12      > JMPZ                                                     ~15, ->14
   17    13    >   ASSIGN                                                   !1, !5
   12    14    > > JMP                                                      ->6
         15    >   FE_FREE                                                  $10
   11    16      > JMP                                                      ->4
         17    >   FE_FREE                                                  $9
   21    18        ROPE_INIT                                     4  ~18     'MinYear+%3D+'
         19        ROPE_ADD                                      1  ~18     ~18, !1
         20        ROPE_ADD                                      2  ~18     ~18, '%2C+MaxYear+%3D+'
         21        ROPE_END                                      3  ~17     ~18, !2
         22        ECHO                                                     ~17
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.89 ms | 1399 KiB | 13 Q