3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = unserialize('O:8:"DateTime":3:{s:4:"date";s:19:"2013-11-26 09:15:42";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";}'); $date = DateTime::createFromFormat('YmdHis', '2004' . $now->format('md') . '235959'); print_r($now); print_r($date); die; $diff = $date->diff($now, true); printf( 'Got %s and expected %s', $now->sub($diff)->format(DateTime::ISO8601), $date->format(DateTime::ISO8601) );

preferences:
46.62 ms | 402 KiB | 5 Q