3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id = '287080904421'; // Extract the "hidden" date part from the ID $date = substr($id, 1, 6); // Arbitrary decision // if year < 70, then assume 21st century // else assume 20th century if (substr($date, 0, 1) < 7) { $date = '20' . $date; } else { $date = '19' . $date; } $birthday = DateTime::createFromFormat('Ymd', $date); echo $birthday->format('Y-m-d'); $now = new DateTime(); $diff = $now->diff($birthday); var_dump($diff); echo $diff->y;

preferences:
31.71 ms | 402 KiB | 5 Q