3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = INF; var_dump((string)$f); var_dump((int)$f); var_dump((bool)$f); echo "--\n"; $f = NAN; var_dump((string)$f); var_dump((int)$f); var_dump((bool)$f);
Output for 8.5.0
string(3) "INF" Warning: The float INF is not representable as an int, cast occurred in /in/lYIng on line 5 int(0) bool(true) -- Warning: unexpected NAN value was coerced to string in /in/lYIng on line 11 string(3) "NAN" Warning: The float NAN is not representable as an int, cast occurred in /in/lYIng on line 12 int(0) Warning: unexpected NAN value was coerced to bool in /in/lYIng on line 13 bool(true)
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14
string(3) "INF" int(0) bool(true) -- string(3) "NAN" int(0) bool(true)

preferences:
59.56 ms | 409 KiB | 5 Q