3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime('now'); $date = DateTime::createFromFormat('YmdHis', '2004' . $now->format('md') . '235959'); print($now, $date); die; $diff = $date->diff($now, true); printf( 'Got %s and expected %s', $now->sub($diff)->format(DateTime::ISO8601), $date->format(DateTime::ISO8601) );
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.22, 5.5.0 - 5.5.6
Parse error: syntax error, unexpected ',' in /in/pHulJ on line 6
Process exited with code 255.

preferences:
190.12 ms | 1387 KiB | 65 Q