3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dob = new \DateTime('28-04-1987'); var_dump($dob->diff(new \DateTime())->y);
based on sgmka
Output for 5.5.0 - 5.5.34, 5.6.0 - 5.6.20, 7.0.0 - 7.0.5, 7.0.20 - 7.3.0beta1
int(28)
Output for 5.5.35, 5.6.21, 7.0.6
int(29)