run code in 300+ PHP versions simultaneously
<?php $dateofbirth = '31/11/80'; $date = DateTime::createFromFormat('d/m/Y', $dateofbirth); $date_errors = DateTime::getLastErrors(); if ($date_errors['warning_count'] + $date_errors['error_count'] > 0) { echo 'Date '.$dateofbirth.' is not a valid DD/MM/YYYY format.'; } else { echo $date->format('Y-m-d'); }
Output for rfc.partials
Date 31/11/80 is not a valid DD/MM/YYYY format.

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

56.72 ms | 458 KiB | 5 Q