3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Get bit in specified position from right (LSB position = 0) function getBIT($number, $position) { return ($number >> $position) & 1;} // Set bit in specified position from right (LSB position = 0) function setBIT($number, $position, $value) { if(getBIT($number, $position)){ if(!$value) { $number -= pow(2, $position); if($color == "r"){ $setBITcountR++; //echo "set BITr "; } if($color == "g"){ $setBITcountG++; //echo "set BITg "; } if($color == "b"){ $setBITcountB++; //echo "set BITb "; } } } else { if($value){ $number += pow(2, $position); if($color == "r"){ $setBITcountR++; //echo "set BITr "; } if($color == "g"){ $setBITcountG++; //echo "set BITg "; } if($color == "b"){ $setBITcountB++; //echo "set BITb "; } } } return $number; } echo decbin(setBIT(0b01101001, 3, 0));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $color in /in/HfVXV on line 10 Warning: Undefined variable $color in /in/HfVXV on line 14 Warning: Undefined variable $color in /in/HfVXV on line 18 1100001

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