3v4l.org

run code in 300+ PHP versions simultaneously
<?php // TL;DR : $output = (intval($x,2) & 1); $a = '123'; $b = '42'; $c= '033'; $d ='0x007'; $e = '010'; $f = '0'; $g= '1'; $h = ''; $i = ' '; $j = "\0"; $k = PHP_INT_MAX; $l = PHP_INT_MIN; $m = PHP_FLOAT_MAX; $n = PHP_FLOAT_MIN; echo implode(PHP_EOL, array_map(fn($item) => 'input : ' . $item . str_repeat('.', strlen($m) - ($item === "\0" ? 0 : strlen($item))) . ' output: ' . (intval($item,2) & 1), [$a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n]));
Output for git.master_jit, git.master
Warning: The float 1.7976931348623157E+308 is not representable as an int, cast occurred in /in/K8bUc on line 22 input : 123................. output: 1 input : 42.................. output: 0 input : 033................. output: 0 input : 0x007............... output: 0 input : 010................. output: 0 input : 0................... output: 0 input : 1................... output: 1 input : .................... output: 0 input : ................... output: 0 input : .................... output: 0 input : 9223372036854775807. output: 1 input : -9223372036854775808 output: 0 input : 1.7976931348623E+308 output: 0 input : 2.2250738585072E-308 output: 0

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:
34.88 ms | 407 KiB | 5 Q