3v4l.org

run code in 300+ PHP versions simultaneously
<?php //get First day of Month //get Last day of Month $first_day_of_month = mktime(0,0,0,date('n'),1,date('Y')); $last_day_of_month = mktime(23,59,59,date('n'),date('t'),date('Y')); echo "First Day of Month: "; echo $first_day_of_month; echo "<br />"; echo "Last Day of Month: "; echo $last_day_of_month; $datetest = array('04-02-2015','11-30-2014', '11-31-2014', '11-08-2014', '11-8-2014', '11-9-2014', '11-11-2014', '11-24-2014', '11-1-2014', '10-30-2014', '12-1-2014', '11-1-1997'); echo "<br /><br />\n\n"; foreach ($datetest as $datetest) { $split_date = explode("-",$datetest); $comp_date = mktime(0,0,0,$split_date[0],$split_date[1],$split_date[2]); if (($comp_date >= $first_day_of_month) && ($comp_date <= $last_day_of_month)){ echo "$datetest :"; echo " Is in Month!"; echo "<br />\n"; } else { echo "$datetest :"; echo "Not in Month!"; echo "<br />\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 41, Position 2 = 76
Branch analysis from position: 41
2 jumps found. (Code = 78) Position 1 = 42, Position 2 = 76
Branch analysis from position: 42
2 jumps found. (Code = 46) Position 1 = 61, Position 2 = 63
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 70
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 63
Branch analysis from position: 76
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 76
filename:       /in/krjIv
function name:  (null)
number of ops:  78
compiled vars:  !0 = $first_day_of_month, !1 = $last_day_of_month, !2 = $datetest, !3 = $split_date, !4 = $comp_date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'mktime'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 0
          4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'n'
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        SEND_VAL                                                 1
          9        INIT_FCALL                                               'date'
         10        SEND_VAL                                                 'Y'
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !0, $7
    7    15        INIT_FCALL                                               'mktime'
         16        SEND_VAL                                                 23
         17        SEND_VAL                                                 59
         18        SEND_VAL                                                 59
         19        INIT_FCALL                                               'date'
         20        SEND_VAL                                                 'n'
         21        DO_ICALL                                         $9      
         22        SEND_VAR                                                 $9
         23        INIT_FCALL                                               'date'
         24        SEND_VAL                                                 't'
         25        DO_ICALL                                         $10     
         26        SEND_VAR                                                 $10
         27        INIT_FCALL                                               'date'
         28        SEND_VAL                                                 'Y'
         29        DO_ICALL                                         $11     
         30        SEND_VAR                                                 $11
         31        DO_ICALL                                         $12     
         32        ASSIGN                                                   !1, $12
    9    33        ECHO                                                     'First+Day+of+Month%3A+'
   10    34        ECHO                                                     !0
   12    35        ECHO                                                     '%3Cbr+%2F%3E'
   14    36        ECHO                                                     'Last+Day+of+Month%3A+'
   15    37        ECHO                                                     !1
   17    38        ASSIGN                                                   !2, <array>
   19    39        ECHO                                                     '%3Cbr+%2F%3E%3Cbr+%2F%3E%0A%0A'
   21    40      > FE_RESET_R                                       $15     !2, ->76
         41    > > FE_FETCH_R                                               $15, !2, ->76
   22    42    >   INIT_FCALL                                               'explode'
         43        SEND_VAL                                                 '-'
         44        SEND_VAR                                                 !2
         45        DO_ICALL                                         $16     
         46        ASSIGN                                                   !3, $16
   24    47        INIT_FCALL                                               'mktime'
         48        SEND_VAL                                                 0
         49        SEND_VAL                                                 0
         50        SEND_VAL                                                 0
         51        FETCH_DIM_R                                      ~18     !3, 0
         52        SEND_VAL                                                 ~18
         53        FETCH_DIM_R                                      ~19     !3, 1
         54        SEND_VAL                                                 ~19
         55        FETCH_DIM_R                                      ~20     !3, 2
         56        SEND_VAL                                                 ~20
         57        DO_ICALL                                         $21     
         58        ASSIGN                                                   !4, $21
   25    59        IS_SMALLER_OR_EQUAL                              ~23     !0, !4
         60      > JMPZ_EX                                          ~23     ~23, ->63
         61    >   IS_SMALLER_OR_EQUAL                              ~24     !4, !1
         62        BOOL                                             ~23     ~24
         63    > > JMPZ                                                     ~23, ->70
   27    64    >   NOP                                                      
         65        FAST_CONCAT                                      ~25     !2, '+%3A'
         66        ECHO                                                     ~25
   28    67        ECHO                                                     '+Is+in+Month%21'
   29    68        ECHO                                                     '%3Cbr+%2F%3E%0A'
         69      > JMP                                                      ->75
   32    70    >   NOP                                                      
         71        FAST_CONCAT                                      ~26     !2, '+%3A'
         72        ECHO                                                     ~26
   33    73        ECHO                                                     'Not+in+Month%21'
   34    74        ECHO                                                     '%3Cbr+%2F%3E%0A'
   21    75    > > JMP                                                      ->41
         76    >   FE_FREE                                                  $15
   36    77      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.24 ms | 1400 KiB | 19 Q