3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = [ '0', '-0', '1', '-1', '0.0', '1.1', '-1.1', '0x111', '0111', '0b111', '-0x111', '-0111', '-0b111', '0.1e2', '-0.1e2', '0.1e-2', '-0.1e-2', ]; printf(' string | float | int' . PHP_EOL); foreach ($values as $value) { $float = filter_var($value, FILTER_VALIDATE_FLOAT, FILTER_REQUIRE_SCALAR); $int = filter_var($value, FILTER_VALIDATE_INT, FILTER_REQUIRE_SCALAR); printf('%7s | %6s | %2s%s', $value, $float, $int, PHP_EOL); }
Output for git.master, git.master_jit, rfc.property-hooks
string | float | int 0 | 0 | 0 -0 | 0 | 0 1 | 1 | 1 -1 | -1 | -1 0.0 | 0 | 1.1 | 1.1 | -1.1 | -1.1 | 0x111 | | 0111 | 111 | 0b111 | | -0x111 | | -0111 | -111 | -0b111 | | 0.1e2 | 10 | -0.1e2 | -10 | 0.1e-2 | 0.001 | -0.1e-2 | -0.001 |

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:
63.24 ms | 402 KiB | 8 Q