3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = date_create_from_format('123', 'foo'); var_dump($date); $date = DateTime::createFromFormat('123', 'foo'); var_dump($date); $interval = date_interval_create_from_date_string('foo'); var_dump($interval); $interval = DateInterval::createFromDateString('foo'); var_dump($interval); $date = new DateTime(); $res = date_modify($date, 'foo'); var_dump($res); $res = $date->modify('foo'); var_dump($res);
Output for git.master, git.master_jit
bool(false) bool(false) Warning: date_interval_create_from_date_string(): Unknown or bad format (foo) at position 0 (f): The timezone could not be found in the database in /in/HjXee on line 8 bool(false) Warning: DateInterval::createFromDateString(): Unknown or bad format (foo) at position 0 (f): The timezone could not be found in the database in /in/HjXee on line 10 bool(false) Warning: date_modify(): Failed to parse time string (foo) at position 0 (f): The timezone could not be found in the database in /in/HjXee on line 14 bool(false) Warning: DateTime::modify(): Failed to parse time string (foo) at position 0 (f): The timezone could not be found in the database in /in/HjXee on line 16 bool(false)
Output for rfc.property-hooks
bool(false) bool(false) Warning: date_interval_create_from_date_string(): Unknown or bad format (foo) at position 0 (f): The timezone could not be found in the database in /in/HjXee on line 8 bool(false) Fatal error: Uncaught DateMalformedIntervalStringException: Unknown or bad format (foo) at position 0 (f): The timezone could not be found in the database in /in/HjXee:10 Stack trace: #0 /in/HjXee(10): DateInterval::createFromDateString('foo') #1 {main} thrown in /in/HjXee on line 10
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:
34.58 ms | 401 KiB | 8 Q