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); $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('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,1,$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 = 32, Position 2 = 67
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 67
Branch analysis from position: 33
2 jumps found. (Code = 46) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 61
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 54
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
filename:       /in/EMMnc
function name:  (null)
number of ops:  69
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        DO_ICALL                                         $5      
          5        ASSIGN                                                   !0, $5
    7     6        INIT_FCALL                                               'mktime'
          7        SEND_VAL                                                 23
          8        SEND_VAL                                                 59
          9        SEND_VAL                                                 59
         10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'n'
         12        DO_ICALL                                         $7      
         13        SEND_VAR                                                 $7
         14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 't'
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        INIT_FCALL                                               'date'
         19        SEND_VAL                                                 'Y'
         20        DO_ICALL                                         $9      
         21        SEND_VAR                                                 $9
         22        DO_ICALL                                         $10     
         23        ASSIGN                                                   !1, $10
    9    24        ECHO                                                     'First+Day+of+Month%3A+'
   10    25        ECHO                                                     !0
   12    26        ECHO                                                     '%3Cbr+%2F%3E'
   14    27        ECHO                                                     'Last+Day+of+Month%3A+'
   15    28        ECHO                                                     !1
   17    29        ASSIGN                                                   !2, <array>
   19    30        ECHO                                                     '%3Cbr+%2F%3E%3Cbr+%2F%3E%0A%0A'
   21    31      > FE_RESET_R                                       $13     !2, ->67
         32    > > FE_FETCH_R                                               $13, !2, ->67
   22    33    >   INIT_FCALL                                               'explode'
         34        SEND_VAL                                                 '-'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                         $14     
         37        ASSIGN                                                   !3, $14
   24    38        INIT_FCALL                                               'mktime'
         39        SEND_VAL                                                 0
         40        SEND_VAL                                                 0
         41        SEND_VAL                                                 1
         42        FETCH_DIM_R                                      ~16     !3, 0
         43        SEND_VAL                                                 ~16
         44        FETCH_DIM_R                                      ~17     !3, 1
         45        SEND_VAL                                                 ~17
         46        FETCH_DIM_R                                      ~18     !3, 2
         47        SEND_VAL                                                 ~18
         48        DO_ICALL                                         $19     
         49        ASSIGN                                                   !4, $19
   25    50        IS_SMALLER_OR_EQUAL                              ~21     !0, !4
         51      > JMPZ_EX                                          ~21     ~21, ->54
         52    >   IS_SMALLER_OR_EQUAL                              ~22     !4, !1
         53        BOOL                                             ~21     ~22
         54    > > JMPZ                                                     ~21, ->61
   27    55    >   NOP                                                      
         56        FAST_CONCAT                                      ~23     !2, '+%3A'
         57        ECHO                                                     ~23
   28    58        ECHO                                                     '+Is+in+Month%21'
   29    59        ECHO                                                     '%3Cbr+%2F%3E%0A'
         60      > JMP                                                      ->66
   32    61    >   NOP                                                      
         62        FAST_CONCAT                                      ~24     !2, '+%3A'
         63        ECHO                                                     ~24
   33    64        ECHO                                                     'Not+in+Month%21'
   34    65        ECHO                                                     '%3Cbr+%2F%3E%0A'
   21    66    > > JMP                                                      ->32
         67    >   FE_FREE                                                  $13
   36    68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.91 ms | 1400 KiB | 19 Q