3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasMatchingBits($x, $y) { $x = strrev(decbin($x)); $y = strrev(decbin($y)); $lengthX = strlen($x); $lengthY = strlen($y); $length = $lengthX < $lengthY ? $lengthX : $lengthY; for ($i = 0; $i < $length; $i++) { if ($x[$i] === '1' && $y[$i] === '1') { return true; } } return false; } echo hasMatchingBits(196, 4) ? "Yes\n" : "No\n"; echo hasMatchingBits(196, 16) ? "Yes\n" : "No\n"; echo hasMatchingBits(4, 16) ? "Yes\n" : "No\n";
Output for git.master, git.master_jit, rfc.property-hooks
Yes No No

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:
32.79 ms | 405 KiB | 5 Q