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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.73 ms | 1400 KiB | 21 Q