3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!class_exists('DateTime')) { die("DateTime did not exist yet\n"); } $sample_data = array( '2015-12-31', '31/12/2015', '12/31/2015', 'Europe/Madrid', 'Asia/Tokyo', 'a', 'b', 'ab', ); foreach ($sample_data as $date_str) { try { $date = new DateTime($date_str); printf("%13s : valid (%s)\n", $date_str, $date->format('c')); } catch (Exception $e) { printf("%13s : not valid\n", $date_str); } }
Output for git.master, git.master_jit, rfc.property-hooks
2015-12-31 : valid (2015-12-31T00:00:00+01:00) 31/12/2015 : not valid 12/31/2015 : valid (2015-12-31T00:00:00+01:00) Europe/Madrid : valid (2015-04-15T17:42:47+02:00) Asia/Tokyo : valid (2015-04-16T00:42:47+09:00) a : valid (2015-04-15T17:42:47+01:00) b : valid (2015-04-15T17:42:47+02:00) ab : not valid

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:
174 ms | 406 KiB | 5 Q