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 git.master, git.master_jit, rfc.property-hooks
int(128) string(8) "10000000" int(-129) Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /in/qOXnd on line 7 string(8) "10000001" int(-129) 1111111111111111111111111111111111111111111111111111111101111111 fffffffffffffff6 -10 1111111111111111111111111111111111111111111111111111111111110110

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:
47.57 ms | 401 KiB | 8 Q