3v4l.org

run code in 300+ PHP versions simultaneously
<?php $birthday = date('Y-m-d', strtotime('2015-02-01')); $birthDate = explode($birthday, '-'); $age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md") ? ((date("Y") - $birthDate[2]) - 1) : (date("Y") - $birthDate[2]));

preferences:
43.29 ms | 402 KiB | 5 Q