3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('DAY', 24*60*60, true); $startDate = date('F d, Y'); $AdExpirationDate = strtotime($startDate . '+120 days'); //Calculate the difference between expiration date and today to see if it expires within 30 days $today = date("F d, Y"); $DayDiff = abs($AdExpirationDate - strtotime($today)); $DaysToExpiration = floor($DayDiff / DAY); if ($DaysToExpiration <= 30) { $Expire30 = true; }else{ $Expire30 = false; } echo $DaysToExpiration ." - "; if($Expire30) { echo "true"; } else { echo "false"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
Branch analysis from position: 42
filename:       /in/qkLE6
function name:  (null)
number of ops:  44
compiled vars:  !0 = $startDate, !1 = $AdExpirationDate, !2 = $today, !3 = $DayDiff, !4 = $DaysToExpiration, !5 = $Expire30
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'DAY'
          2        SEND_VAL                                                 86400
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                                 
    5     5        INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'F+d%2C+Y'
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !0, $7
    8     9        INIT_FCALL                                               'strtotime'
         10        CONCAT                                           ~9      !0, '%2B120+days'
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !1, $10
   11    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'F+d%2C+Y'
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !2, $12
   12    18        INIT_FCALL                                               'abs'
         19        INIT_FCALL                                               'strtotime'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $14     
         22        SUB                                              ~15     !1, $14
         23        SEND_VAL                                                 ~15
         24        DO_ICALL                                         $16     
         25        ASSIGN                                                   !3, $16
   14    26        INIT_FCALL                                               'floor'
         27        FETCH_CONSTANT                                   ~18     'DAY'
         28        DIV                                              ~19     !3, ~18
         29        SEND_VAL                                                 ~19
         30        DO_ICALL                                         $20     
         31        ASSIGN                                                   !4, $20
   15    32        IS_SMALLER_OR_EQUAL                                      !4, 30
         33      > JMPZ                                                     ~22, ->36
   16    34    >   ASSIGN                                                   !5, <true>
         35      > JMP                                                      ->37
   18    36    >   ASSIGN                                                   !5, <false>
   21    37    >   CONCAT                                           ~25     !4, '+-+'
         38        ECHO                                                     ~25
   23    39      > JMPZ                                                     !5, ->42
   24    40    >   ECHO                                                     'true'
         41      > JMP                                                      ->43
   26    42    >   ECHO                                                     'false'
   29    43    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.69 ms | 1400 KiB | 23 Q