3v4l.org

run code in 300+ PHP versions simultaneously
<?php $today = new DateTime(); $birthdate = new DateTime("1973-04-18"); $interval = $today->diff($birthdate); echo $interval->format('%y years'); $Birth = new DateTime('1973-04-18'); $Other = new DateTime(time()); echo $Birth->diff($Other)->format('%y');

preferences:
27.62 ms | 402 KiB | 5 Q