3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new DateTime('2015-1-31'); $b = new DateTime('2015-2-1'); $a->add(new DateInterval('P1M')); echo $a->format('Y-m-d'); echo date('Y-m-d', strtotime('+1 month', strtotime('2015-1-31'))); echo $a < $b ? 'ja' : 'nein';

preferences:
27.58 ms | 402 KiB | 5 Q