3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateofbirth = '30/11/80'; $date = DateTime::createFromFormat('d/m/Y', $dateofbirth); if ($date === false) { echo 'date error !'; } $date_errors = DateTime::getLastErrors(); var_dump($date_errors); if ($date_errors['warning_count'] + $date_errors['error_count'] > 0) { $dobError = 'Date '.$dateofbirth.' is not a valid DD/MM/YYYY format.'; echo $dobError; $hasError = true; } else { $mysql_dob = $date->format('Y-m-d'); } error_log($dateofbirth.' -> '.$mysql_dob);
Output for git.master, git.master_jit
bool(false) Warning: Trying to access array offset on value of type bool in /in/JunfD on line 11 Warning: Trying to access array offset on value of type bool in /in/JunfD on line 11 30/11/80 -> 0080-11-30
Output for rfc.property-hooks
bool(false) Warning: Trying to access array offset on false in /in/JunfD on line 11 Warning: Trying to access array offset on false in /in/JunfD on line 11 30/11/80 -> 0080-11-30

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