3v4l.org

run code in 300+ PHP versions simultaneously
<?php //date in mm/dd/yyyy format; or it can be in other formats as well $birthDate = "12/17/1983"; //explode the date to get month, day and year $birthDate = explode("/", $birthDate); //get age from date or birthdate $age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md") ? ((date("Y") - $birthDate[2]) - 1) : (date("Y") - $birthDate[2])); echo "Age is:" . $age;
Output for git.master, git.master_jit, rfc.property-hooks
Age is:30

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.06 ms | 401 KiB | 8 Q