High end php programation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

High end php programation

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Wow.. I have no idea what you're talking about.
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post 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);
Post Reply