3v4l.org

run code in 300+ PHP versions simultaneously
<?php global $🚀; $🚀 = 0; function 🤔($🏷, $🤔 = 0, \Closure $b = null) { global $🚀; echo str_repeat(' ', $🚀) + ($🤔 ? "" : "🚫 ") . $🏷; $🚀 += 4; if ($b !== null) $b(); $🚀 -= 4; } 🤔("Math", null, function(){ 🤔("Addition", null, function(){ 🤔("One plus one equals two.", 1+1 == 2); 🤔("One plus one equals eleven. (This should fail.)", 1+1 == 11); }); 🤔("Subtraction", null, function(){ 🤔("One minus one equals zero.", 1-1 == 0); 🤔("Ten minus one equal nine.", 10-1 == 9); }); });
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: Unsupported operand types: string + string in /in/uU94b:9 Stack trace: #0 /in/uU94b(15): 🤔('Math', NULL, Object(Closure)) #1 {main} thrown in /in/uU94b on line 9
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27
Fatal error: Uncaught TypeError: Unsupported operand types: string + string in /in/uU94b:9 Stack trace: #0 /in/uU94b(24): 🤔('Math', NULL, Object(Closure)) #1 {main} thrown in /in/uU94b on line 9
Process exited with code 255.
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Warning: A non-numeric value encountered in /in/uU94b on line 9 Warning: A non-numeric value encountered in /in/uU94b on line 9 0Math Warning: A non-numeric value encountered in /in/uU94b on line 9 Warning: A non-numeric value encountered in /in/uU94b on line 9 0Addition Warning: A non-numeric value encountered in /in/uU94b on line 9 Warning: A non-numeric value encountered in /in/uU94b on line 9 0One plus one equals two. Warning: A non-numeric value encountered in /in/uU94b on line 9 Warning: A non-numeric value encountered in /in/uU94b on line 9 0One plus one equals eleven. (This should fail.) Warning: A non-numeric value encountered in /in/uU94b on line 9 Warning: A non-numeric value encountered in /in/uU94b on line 9 0Subtraction Warning: A non-numeric value encountered in /in/uU94b on line 9 Warning: A non-numeric value encountered in /in/uU94b on line 9 0One minus one equals zero. Warning: A non-numeric value encountered in /in/uU94b on line 9 Warning: A non-numeric value encountered in /in/uU94b on line 9 0Ten minus one equal nine.

preferences:
174.61 ms | 404 KiB | 158 Q