3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!class_exists('DateTime') ) { die('Feature not available yet'); } echo "Same date:\n"; $a = new DateTime('2015-01-31 01:23:45 UTC'); $b = new DateTime('2015-01-31 02:23:45 Europe/Paris'); var_dump($a, $b, $a<$b, $a==$b, $a>$b); echo "\n"; echo "First greater than second:\n"; $a = new DateTime('2015-01-31 01:23:46 UTC'); $b = new DateTime('2015-01-31 02:23:45 Europe/Paris'); var_dump($a, $b, $a<$b, $a==$b, $a>$b); echo "\n"; echo "First less than second:\n"; $a = new DateTime('2015-01-31 01:23:45 UTC'); $b = new DateTime('2015-01-31 02:23:46 Europe/Paris'); var_dump($a, $b, $a<$b, $a==$b, $a>$b);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qPhOH
function name:  (null)
number of ops:  66
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'class_exists'
          1        SEND_VAL                                                 'DateTime'
          2        DO_ICALL                                         $2      
          3        BOOL_NOT                                         ~3      $2
          4      > JMPZ                                                     ~3, ->6
    4     5    > > EXIT                                                     'Feature+not+available+yet'
    7     6    >   ECHO                                                     'Same+date%3A%0A'
    8     7        NEW                                              $4      'DateTime'
          8        SEND_VAL_EX                                              '2015-01-31+01%3A23%3A45+UTC'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !0, $4
    9    11        NEW                                              $7      'DateTime'
         12        SEND_VAL_EX                                              '2015-01-31+02%3A23%3A45+Europe%2FParis'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !1, $7
   10    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        IS_SMALLER                                       ~10     !0, !1
         19        SEND_VAL                                                 ~10
         20        IS_EQUAL                                         ~11     !0, !1
         21        SEND_VAL                                                 ~11
         22        IS_SMALLER                                       ~12     !1, !0
         23        SEND_VAL                                                 ~12
         24        DO_ICALL                                                 
   11    25        ECHO                                                     '%0A'
   13    26        ECHO                                                     'First+greater+than+second%3A%0A'
   14    27        NEW                                              $14     'DateTime'
         28        SEND_VAL_EX                                              '2015-01-31+01%3A23%3A46+UTC'
         29        DO_FCALL                                      0          
         30        ASSIGN                                                   !0, $14
   15    31        NEW                                              $17     'DateTime'
         32        SEND_VAL_EX                                              '2015-01-31+02%3A23%3A45+Europe%2FParis'
         33        DO_FCALL                                      0          
         34        ASSIGN                                                   !1, $17
   16    35        INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !0
         37        SEND_VAR                                                 !1
         38        IS_SMALLER                                       ~20     !0, !1
         39        SEND_VAL                                                 ~20
         40        IS_EQUAL                                         ~21     !0, !1
         41        SEND_VAL                                                 ~21
         42        IS_SMALLER                                       ~22     !1, !0
         43        SEND_VAL                                                 ~22
         44        DO_ICALL                                                 
   17    45        ECHO                                                     '%0A'
   19    46        ECHO                                                     'First+less+than+second%3A%0A'
   20    47        NEW                                              $24     'DateTime'
         48        SEND_VAL_EX                                              '2015-01-31+01%3A23%3A45+UTC'
         49        DO_FCALL                                      0          
         50        ASSIGN                                                   !0, $24
   21    51        NEW                                              $27     'DateTime'
         52        SEND_VAL_EX                                              '2015-01-31+02%3A23%3A46+Europe%2FParis'
         53        DO_FCALL                                      0          
         54        ASSIGN                                                   !1, $27
   22    55        INIT_FCALL                                               'var_dump'
         56        SEND_VAR                                                 !0
         57        SEND_VAR                                                 !1
         58        IS_SMALLER                                       ~30     !0, !1
         59        SEND_VAL                                                 ~30
         60        IS_EQUAL                                         ~31     !0, !1
         61        SEND_VAL                                                 ~31
         62        IS_SMALLER                                       ~32     !1, !0
         63        SEND_VAL                                                 ~32
         64        DO_ICALL                                                 
         65      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.35 ms | 1465 KiB | 15 Q