3v4l.org

run code in 300+ PHP versions simultaneously
<?php $today_y = date("Y"); $today_m = date("m"); $today_d = date("d"); list($birthday_y, $birthday_m, $birthday_d) = explode('/', str_replace('-','/',$birthday)); $age = $today_y - $birthday_y; //誕生日前なら1才引く if( $today_m*100 + $today_d < $birthday_m*100 + $birthday_d ){ $age--; } echo $age;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $birthday in /in/6qBko on line 6 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/6qBko on line 6 Warning: Undefined array key 1 in /in/6qBko on line 6 Warning: Undefined array key 2 in /in/6qBko on line 6 Fatal error: Uncaught TypeError: Unsupported operand types: string - string in /in/6qBko:8 Stack trace: #0 {main} thrown in /in/6qBko on line 8
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:
44.38 ms | 402 KiB | 8 Q