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'); $diff = $date->diff($now, true); print_r($now->sub(date_interval_create_from_date_string('3286 days 09:15:43'))); die; printf( 'Got %s and expected %s', $now->sub($diff)->format(DateTime::ISO8601), $date->format(DateTime::ISO8601) );
Output for git.master, git.master_jit
Warning: date_interval_create_from_date_string(): String '3286 days 09:15:43' contains non-relative elements in /in/qZR2E on line 7 Fatal error: Uncaught TypeError: DateTime::sub(): Argument #1 ($interval) must be of type DateInterval, bool given in /in/qZR2E:7 Stack trace: #0 /in/qZR2E(7): DateTime->sub(false) #1 {main} thrown in /in/qZR2E on line 7
Process exited with code 255.
Output for rfc.property-hooks
Warning: date_interval_create_from_date_string(): String '3286 days 09:15:43' contains non-relative elements in /in/qZR2E on line 7 Fatal error: Uncaught TypeError: DateTime::sub(): Argument #1 ($interval) must be of type DateInterval, false given in /in/qZR2E:7 Stack trace: #0 /in/qZR2E(7): DateTime->sub(false) #1 {main} thrown in /in/qZR2E on line 7
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.38 ms | 401 KiB | 8 Q