3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = '1990-07-22 00:00:00'; $year_calc = 60 * 60 * 24 * 365; $year_strict = 31556926; var_dump([ 'year_calc' => $year_calc, 'year_strict' => $year_strict, 'now' => time(), 'age_calc' => floor(abs((time() - strtotime($dt))/$year_calc)), 'age_strict' => floor(abs((time() - strtotime($dt))/$year_strict)), ]);

preferences:
31.05 ms | 402 KiB | 5 Q