Page 1 of 1
High end php programation
Posted: Sat Mar 10, 2007 2:01 pm
by visonardo
Do someone see some example of this tipe of programation with php? for example that if you need a var that act as a flag, not use a single var, because it use so much memory that really that need, you would use one that use just a bit. 0 or 1 and thus with all sentences. I guess that the script would be sooo quickly and would not use so much memory. It would be so good.
Posted: Sat Mar 10, 2007 2:07 pm
by feyd
Wow.. I have no idea what you're talking about.
Posted: Sat Mar 10, 2007 2:30 pm
by stereofrog
If you're referring to bitfields or packed arrays, the answer is no, php doesn't support this. However, php has the full set of bit arithmetic, so you can use bit flags just like in C:
Code: Select all
define('READ', 1 << 0);
define('WRITE', 1 << 1);
define('ASCII', 1 << 2);
define('BINARY', 1 << 3);
open_something(READ|BINARY);