3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a($value) { return is_nan($value) ? null : $value; } function b($value) { return is_float($value) && is_nan($value) ? null : $value; } function meh($value) { var_dump(a($value) === b($value)); } foreach (array(0, NAN, "asdf", 2.4) as $value) { meh($value); }
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(true) Fatal error: Uncaught TypeError: is_nan(): Argument #1 ($num) must be of type float, string given in /in/4F244:4 Stack trace: #0 /in/4F244(4): is_nan('asdf') #1 /in/4F244(12): a('asdf') #2 /in/4F244(16): meh('asdf') #3 {main} thrown in /in/4F244 on line 4
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:
36.58 ms | 401 KiB | 8 Q