3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [['dt' => 1523728800], ['dt' => 1523739600], ['dt' => 1528739600]]; $daystart = strtotime(date("Y-m-d 00:00:00")); $dayend = strtotime(date("Y-m-d 23:59:59")); Foreach($arr as $val){ If($val['dt'] >= $daystart && $val['dt'] <= $dayend){ $res[] = $val; } } Var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 26
Branch analysis from position: 23
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/kedRX
function name:  (null)
number of ops:  32
compiled vars:  !0 = $arr, !1 = $daystart, !2 = $dayend, !3 = $val, !4 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'strtotime'
          2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'Y-m-d+00%3A00%3A00'
          4        DO_ICALL                                         $6      
          5        SEND_VAR                                                 $6
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
    6     8        INIT_FCALL                                               'strtotime'
          9        INIT_FCALL                                               'date'
         10        SEND_VAL                                                 'Y-m-d+23%3A59%3A59'
         11        DO_ICALL                                         $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                         $10     
         14        ASSIGN                                                   !2, $10
    7    15      > FE_RESET_R                                       $12     !0, ->27
         16    > > FE_FETCH_R                                               $12, !3, ->27
    8    17    >   FETCH_DIM_R                                      ~13     !3, 'dt'
         18        IS_SMALLER_OR_EQUAL                              ~14     !1, ~13
         19      > JMPZ_EX                                          ~14     ~14, ->23
         20    >   FETCH_DIM_R                                      ~15     !3, 'dt'
         21        IS_SMALLER_OR_EQUAL                              ~16     ~15, !2
         22        BOOL                                             ~14     ~16
         23    > > JMPZ                                                     ~14, ->26
    9    24    >   ASSIGN_DIM                                               !4
         25        OP_DATA                                                  !3
    7    26    > > JMP                                                      ->16
         27    >   FE_FREE                                                  $12
   12    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.88 ms | 1401 KiB | 19 Q