3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = array("2013-12-24","2013-12-25","2014-12-24","2013-12-27"); $start = '2013-12-25'; $end = '2013-12-26'; $dates_in_range = array_filter($dates, function($date) { //global $start; //global $end; return (strtotime($date) >= strtotime($start) and strtotime($date) <= strtotime($end)); }); print_r($dates_in_range);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l18tI
function name:  (null)
number of ops:  13
compiled vars:  !0 = $dates, !1 = $start, !2 = $end, !3 = $dates_in_range
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, '2013-12-25'
    5     2        ASSIGN                                                   !2, '2013-12-26'
    7     3        INIT_FCALL                                               'array_filter'
          4        SEND_VAR                                                 !0
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fl18tI%3A7%240'
   11     6        SEND_VAL                                                 ~7
          7        DO_ICALL                                         $8      
    7     8        ASSIGN                                                   !3, $8
   13     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fl18tI%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/l18tI
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $date, !1 = $start, !2 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'strtotime'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        IS_SMALLER_OR_EQUAL                              ~5      $4, $3
          8      > JMPZ_EX                                          ~5      ~5, ->17
          9    >   INIT_FCALL                                               'strtotime'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        INIT_FCALL                                               'strtotime'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $7      
         15        IS_SMALLER_OR_EQUAL                              ~8      $6, $7
         16        BOOL                                             ~5      ~8
         17    > > RETURN                                                   ~5
   11    18*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fl18tI%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.48 ms | 1396 KiB | 19 Q