3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('2015-01-01'); $ret = $date->modify('lol fail'); echo '$ret = '; var_dump($ret); echo "\n\$date = "; var_dump($date);
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.6.30, hhvm-3.11.1 - 3.17.3, 7.0.0 - 7.2.0
Warning: DateTime::modify(): Failed to parse time string (lol fail) at position 0 (l): The timezone could not be found in the database in /in/dhssE on line 3 $ret = bool(false) $date = object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.10.1
$ret = object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } $date = object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.0 - 5.4.29, 5.5.0 - 5.5.13
Warning: DateTime::modify(): Failed to parse time string (lol fail) at position 0 (l): The timezone could not be found in the database in /in/dhssE on line 3 $ret = bool(false) $date = object(DateTime)#1 (3) { ["date"]=> string(19) "2015-01-01 00:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }