3v4l.org

run code in 300+ PHP versions simultaneously
<?php $year = 1999; $month = 2; $day = 6; $birthday = $month.$day.$year; // validate birthday function validateAge($birthday, $age = 25) { // $birthday can be UNIX_TIMESTAMP or just a string-date. if(is_string($birthday)) { $birthday = strtotime($birthday); echo "OLDER THAN 25!!!"; } // check // 31536000 is the number of seconds in a 365 days year. if(time() - $birthday < $age * 31536000) { echo "NOT OLDER THAN 25!!!"; return false; } return true; }

preferences:
33.77 ms | 402 KiB | 5 Q