Created
March 23, 2012 20:31
-
-
Save mikelbring/2174664 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Here we're setting BIT_0, BIT_1, ..., BIT_15 for use with octal notation | |
//It's basically saving 1,2,4,8,16, ..., 32768 to prevent possible typos and less calculations | |
// 2^n = BIT_n | |
$t = 1; | |
for ($i = 0; $i < 16; $i++) { | |
define('BIT_' . $i, $t); | |
$t <<= 1; | |
} | |
unset($t); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment