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 = new DateTime("Y-m-d"); // foreach($date_array as $date) { $match_date = new DateTime($date); var_dump($now); $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/Z5TPk
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     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 = 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
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/Z5TPk
function name:  is_today
number of ops:  21
compiled vars:  !0 = $date_array, !1 = $now, !2 = $date, !3 = $match_date, !4 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   28     1        NEW                                              $6      'DateTime'
          2        SEND_VAL_EX                                              'Y-m-d'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
   30     5      > FE_RESET_R                                       $9      !0, ->19
          6    > > FE_FETCH_R                                               $9, !2, ->19
   31     7    >   NEW                                              $10     'DateTime'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !3, $10
   32    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   33    14        INIT_METHOD_CALL                                         !1, 'diff'
         15        SEND_VAR_EX                                              !3
         16        DO_FCALL                                      0  $14     
         17        ASSIGN                                                   !4, $14
   30    18      > JMP                                                      ->6
         19    >   FE_FREE                                                  $9
   41    20      > RETURN                                                   null

End of function is_today

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.1 ms | 1399 KiB | 16 Q