3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array( "name" => "MCLE 201", "date-begin" => "2015-06-29", "date-end" => "2015-06-29" ), array( "name" => "MCLE 201", "date-begin" => "2015-07-29", "date-end" => "2015-07-29" ), array( "name" => "MCLE 201", "date-begin" => "2015-08-29", "date-end" => "2015-08-29" ), array( "name" => "MCLE 201", "date-begin" => "2015-09-29", "date-end" => "2015-09-29" ) ); $postedDateBegin = "2015-06-29"; $postedDateEnd = "2015-08-29"; $filterArray = array(); foreach($arr as $key=>$val){ if(strtotime($val['date-begin']) >= strtotime($postedDateBegin) && strtotime($val['date-end']) <= strtotime($postedDateEnd)){ $filterArray[] = $val; } } echo "<pre>"; print_r($filterArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 29
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 29
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 28
Branch analysis from position: 25
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/nK4BP
function name:  (null)
number of ops:  35
compiled vars:  !0 = $arr, !1 = $postedDateBegin, !2 = $postedDateEnd, !3 = $filterArray, !4 = $val, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   28     1        ASSIGN                                                   !1, '2015-06-29'
   29     2        ASSIGN                                                   !2, '2015-08-29'
   30     3        ASSIGN                                                   !3, <array>
   31     4      > FE_RESET_R                                       $10     !0, ->29
          5    > > FE_FETCH_R                                       ~11     $10, !4, ->29
          6    >   ASSIGN                                                   !5, ~11
   32     7        INIT_FCALL                                               'strtotime'
          8        FETCH_DIM_R                                      ~13     !4, 'date-begin'
          9        SEND_VAL                                                 ~13
         10        DO_ICALL                                         $14     
         11        INIT_FCALL                                               'strtotime'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $15     
         14        IS_SMALLER_OR_EQUAL                              ~16     $15, $14
         15      > JMPZ_EX                                          ~16     ~16, ->25
         16    >   INIT_FCALL                                               'strtotime'
         17        FETCH_DIM_R                                      ~17     !4, 'date-end'
         18        SEND_VAL                                                 ~17
         19        DO_ICALL                                         $18     
         20        INIT_FCALL                                               'strtotime'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $19     
         23        IS_SMALLER_OR_EQUAL                              ~20     $18, $19
         24        BOOL                                             ~16     ~20
         25    > > JMPZ                                                     ~16, ->28
   33    26    >   ASSIGN_DIM                                               !3
         27        OP_DATA                                                  !4
   31    28    > > JMP                                                      ->5
         29    >   FE_FREE                                                  $10
   36    30        ECHO                                                     '%3Cpre%3E'
         31        INIT_FCALL                                               'print_r'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.39 ms | 1012 KiB | 15 Q