3v4l.org

run code in 300+ PHP versions simultaneously
<?php $from = new DateTime('24 June 1940'); $till = new DateTime('now'); list($fromYear, $fromDay) = explode(' ', $from->format('Y z')); list($tillYear, $tillDay) = explode(' ', $till->format('Y z')); $age = $tillYear - $fromYear - ($tillDay < $fromDay); print $age;

preferences:
36.68 ms | 402 KiB | 5 Q