3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = ['2011-04-11', '2011-06-28', '2011-09-26', '2012-01-02', '2012-05-12']; $startdates = [ 10 => '2011-01-01', 20 => '2011-07-01', 30 => '2012-01-01', 40 => '2012-07-01' ]; $enddates = [ 10 => '2011-06-30', 20 => '2011-12-31', 30 => '2012-06-30', 40 => '2012-12-31' ]; foreach ($dates as $date) { foreach ($startdates as $key => $startdate) { if ($date >= $startdate && $date <= $enddates[$key]) { $result[$date] = $key; continue 2; } } $result[$date] = 'out of bounds'; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 23
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 23
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/UL127
function name:  (null)
number of ops:  28
compiled vars:  !0 = $dates, !1 = $startdates, !2 = $enddates, !3 = $date, !4 = $startdate, !5 = $key, !6 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
   10     2        ASSIGN                                                   !2, <array>
   17     3      > FE_RESET_R                                       $10     !0, ->23
          4    > > FE_FETCH_R                                               $10, !3, ->23
   18     5    > > FE_RESET_R                                       $11     !1, ->19
          6    > > FE_FETCH_R                                       ~12     $11, !4, ->19
          7    >   ASSIGN                                                   !5, ~12
   19     8        IS_SMALLER_OR_EQUAL                              ~14     !4, !3
          9      > JMPZ_EX                                          ~14     ~14, ->13
         10    >   FETCH_DIM_R                                      ~15     !2, !5
         11        IS_SMALLER_OR_EQUAL                              ~16     !3, ~15
         12        BOOL                                             ~14     ~16
         13    > > JMPZ                                                     ~14, ->18
   20    14    >   ASSIGN_DIM                                               !6, !3
         15        OP_DATA                                                  !5
   21    16        FE_FREE                                                  $11
         17      > JMP                                                      ->4
   18    18    > > JMP                                                      ->6
         19    >   FE_FREE                                                  $11
   24    20        ASSIGN_DIM                                               !6, !3
         21        OP_DATA                                                  'out+of+bounds'
   17    22      > JMP                                                      ->4
         23    >   FE_FREE                                                  $10
   26    24        INIT_FCALL                                               'var_export'
         25        SEND_VAR                                                 !6
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.98 ms | 999 KiB | 14 Q