3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($f) { try { $f(); echo "No error?\n"; } catch (TypeError|ValueError $e) { if (strpos($e->getMessage(), '($WRONG_SCOPE_')) { echo "Bad error! ", $e->getMessage(), "\n"; } else { echo "Good error.\n"; } } } test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) < "x"); test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) < []); test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) + "x"); test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) + []);
Output for git.master, git.master_jit, rfc.property-hooks
Good error. Good error. Good error. Good error.

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