gmp_setbit

PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
gmp_setbit - Set bit
Manual
Code Examples

Example #1 gmp_setbit example - 0 index

Result: 2 -> 0b10 3 -> 0b11
PHP Version:

Example #2 gmp_setbit example - 1 index

Result: 253 -> 0b11111101 255 -> 0b11111111
PHP Version:

Example #3 gmp_setbit example - clearing a bit

Result: 255 -> 0b11111111 254 -> 0b11111110
PHP Version: