3v4l.org

run code in 300+ PHP versions simultaneously
<?php function validateDateA($date, $format = 'Y-m-d') { $dt = DateTime::createFromFormat($format, $date); return $dt && $dt->format($format) == $date; } function validateDateB($date, $format = 'Y-m-d') { DateTime::createFromFormat($format, $date); $a = DateTime::getLastErrors(); return !$a['warning_count'] && !$a['error_count']; } var_dump(validateDateA('Tue, 27 Feb 2012 12:12:12 +0200', DateTime::RSS)); # false var_dump(validateDateA('Mon, 29 Feb 2012 12:12:12 +0200', DateTime::RSS)); # true var_dump(validateDateB('Tue, 27 Feb 2012 12:12:12 +0200', DateTime::RSS)); # true var_dump(validateDateB('Fri, 27 Feb 2012 12:12:12 +0200', DateTime::RSS)); # true var_dump(validateDateB('Xxx, 27 Feb 2012 12:12:12 +0200', DateTime::RSS)); # false var_dump(validateDateB('Aaa, 27 Feb 2012 12:12:12 +0200', DateTime::RSS)); # false
Output for git.master, git.master_jit
bool(false) bool(false) Warning: Trying to access array offset on value of type bool in /in/soYQa on line 12 Warning: Trying to access array offset on value of type bool in /in/soYQa on line 12 bool(true) Warning: Trying to access array offset on value of type bool in /in/soYQa on line 12 Warning: Trying to access array offset on value of type bool in /in/soYQa on line 12 bool(true) bool(false) bool(false)
Output for rfc.property-hooks
bool(false) bool(false) Warning: Trying to access array offset on false in /in/soYQa on line 12 Warning: Trying to access array offset on false in /in/soYQa on line 12 bool(true) Warning: Trying to access array offset on false in /in/soYQa on line 12 Warning: Trying to access array offset on false in /in/soYQa on line 12 bool(true) bool(false) bool(false)

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:
46.96 ms | 401 KiB | 8 Q