3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0x80; // 128 base 10 var_dump($a); var_dump(base_convert($a, 10, 2)); // not base_convert($a, 16, 2) $b = ~$a; // -128 - 1 == -129 base 10 var_dump($b); var_dump(base_convert($b, 10, 2), $b);// not base_convert($b, 16,2); can base_convert handle negative values? printf("%b", $b); echo "\n\n"; $x = 10; printf("%x %d %b,$x,$x,$x);
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected end of file in /in/Ykd35 on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/Ykd35 on line 11
Process exited with code 255.

preferences:
164.11 ms | 1395 KiB | 60 Q