3v4l.org

run code in 300+ PHP versions simultaneously
<?php $day = 10; $month = 12; $year = 88; $format = strlen($year) == 2 ? "y-m-d" : "Y-m-d"; $dt = date_create_from_format($format, $year.'-'.$month.'-'.$day)->format("Y-m-d"); print_r($dt);

preferences:
15.59 ms | 402 KiB | 5 Q