3v4l.org

run code in 300+ PHP versions simultaneously
<?php //get First day of Month //get Last day of Month $first_day_of_month = strtotime(date('m-01-Y')); $last_day_of_month = strtotime(date('m-t-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 $datetesta) { $comp_date = strtotime($datetesta); if (($comp_date >= $first_day_of_month) && ($comp_date <= $last_day_of_month)){ echo "$comp_date :"; echo " Is in Month!"; echo "<br />\n"; } else { echo "$comp_date :"; echo "Not in Month!"; echo "<br />\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 44
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 44
Branch analysis from position: 23
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 31
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
filename:       /in/AqrlC
function name:  (null)
number of ops:  46
compiled vars:  !0 = $first_day_of_month, !1 = $last_day_of_month, !2 = $datetest, !3 = $datetesta, !4 = $comp_date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'strtotime'
          1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'm-01-Y'
          3        DO_ICALL                                         $5      
          4        SEND_VAR                                                 $5
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !0, $6
    7     7        INIT_FCALL                                               'strtotime'
          8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'm-t-Y'
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !1, $9
    9    14        ECHO                                                     'First+Day+of+Month%3A+'
   10    15        ECHO                                                     !0
   12    16        ECHO                                                     '%3Cbr+%2F%3E'
   14    17        ECHO                                                     'Last+Day+of+Month%3A+'
   15    18        ECHO                                                     !1
   17    19        ASSIGN                                                   !2, <array>
   19    20        ECHO                                                     '%3Cbr+%2F%3E%3Cbr+%2F%3E%0A%0A'
   21    21      > FE_RESET_R                                       $12     !2, ->44
         22    > > FE_FETCH_R                                               $12, !3, ->44
   22    23    >   INIT_FCALL                                               'strtotime'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                         $13     
         26        ASSIGN                                                   !4, $13
   23    27        IS_SMALLER_OR_EQUAL                              ~15     !0, !4
         28      > JMPZ_EX                                          ~15     ~15, ->31
         29    >   IS_SMALLER_OR_EQUAL                              ~16     !4, !1
         30        BOOL                                             ~15     ~16
         31    > > JMPZ                                                     ~15, ->38
   25    32    >   NOP                                                      
         33        FAST_CONCAT                                      ~17     !4, '+%3A'
         34        ECHO                                                     ~17
   26    35        ECHO                                                     '+Is+in+Month%21'
   27    36        ECHO                                                     '%3Cbr+%2F%3E%0A'
         37      > JMP                                                      ->43
   30    38    >   NOP                                                      
         39        FAST_CONCAT                                      ~18     !4, '+%3A'
         40        ECHO                                                     ~18
   31    41        ECHO                                                     'Not+in+Month%21'
   32    42        ECHO                                                     '%3Cbr+%2F%3E%0A'
   21    43    > > JMP                                                      ->22
         44    >   FE_FREE                                                  $12
   34    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.97 ms | 1400 KiB | 17 Q