3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_today() { $date_array = array( '28-10-2018', '4-11-2018', '25-11-2018', '2-12-2018', '16-12-2018', '23-12-2018', '30-12-2018', '27-01-2019', '24-02-2019', '31-03-2019', '14-04-2019', '28-04-2019', '26-05-2019', '30-06-2019', '28-07-2019', '25-08-2019', '29-09-2019', '27-10-2019', '24-11-2019', '15-12-2019', '22-12-2019', '29-12-2019' ); $now = date("Y-m-d"); $now_datetime = new DateTime($now); // foreach($date_array as $date) { $match_date = new DateTime($date); var_dump($now_datetime); $interval = $now->diff($match_date); // if($interval->days === 0) { // return true; // break; // } else { // return false; // } } } var_dump(is_today());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tic7D
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'is_today'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function is_today:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 23
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/Tic7D
function name:  is_today
number of ops:  25
compiled vars:  !0 = $date_array, !1 = $now, !2 = $now_datetime, !3 = $date, !4 = $match_date, !5 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   28     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m-d'
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !1, $7
   29     5        NEW                                              $9      'DateTime'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $9
   31     9      > FE_RESET_R                                       $12     !0, ->23
         10    > > FE_FETCH_R                                               $12, !3, ->23
   32    11    >   NEW                                              $13     'DateTime'
         12        SEND_VAR_EX                                              !3
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !4, $13
   33    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
   34    18        INIT_METHOD_CALL                                         !1, 'diff'
         19        SEND_VAR_EX                                              !4
         20        DO_FCALL                                      0  $17     
         21        ASSIGN                                                   !5, $17
   31    22      > JMP                                                      ->10
         23    >   FE_FREE                                                  $12
   42    24      > RETURN                                                   null

End of function is_today

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.95 ms | 944 KiB | 19 Q