3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date_set = date("Y-m-d", strtotime('101-12-2024')); $date_now = date("d-m-Y"); // this format is string comparable if ($date_set > '20-12-2024') { echo 'greater than'; }else{ echo 'Less than'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h5D8j
function name:  (null)
number of ops:  18
compiled vars:  !0 = $date_set, !1 = $date_now
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Y-m-d'
          2        INIT_FCALL                                               'strtotime'
          3        SEND_VAL                                                 '101-12-2024'
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
    7     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'd-m-Y'
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !1, $5
    9    12        IS_SMALLER                                               '20-12-2024', !0
         13      > JMPZ                                                     ~7, ->16
   10    14    >   ECHO                                                     'greater+than'
    9    15      > JMP                                                      ->17
   12    16    >   ECHO                                                     'Less+than'
   13    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.95 ms | 1460 KiB | 15 Q