3v4l.org

run code in 300+ PHP versions simultaneously
<?php // todays date $today = date("Ymd"); function age($birth_date){ list($birth_day,$birth_month,$birth_year) = explode("-",$birth_date); $year_diff = date("Y") - $birth_year; $month_diff = date("m") - $birth_month; $day_diff = date("d") - $birth_day; if ($day_diff < 0 && $month_diff==0){$year_diff--;} if ($day_diff < 0 && $month_diff < 0){$year_diff--;} return $year_diff; } //Call the age function age();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function age(), 0 passed in /in/oqm7T on line 15 and exactly 1 expected in /in/oqm7T:5 Stack trace: #0 /in/oqm7T(15): age() #1 {main} thrown in /in/oqm7T on line 5
Process exited with code 255.

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:
50.84 ms | 401 KiB | 8 Q