Graham Kelly wrote:
Hi,

I think the reason there aren't more primitive types in PHP is because of
the nature of the language. One of the main features of PHP over say, C (and
even Java), is that the memory managment is completely transparent to the
devloper. This means that it really shouldent matter to the devloper how an
integer is  implimented on the machine. Same with doubles and chars.
Granted, I can see some reasons why forcing the data to be of a specific
length or type would be handy, but I dont know if there would be a wide
enough requierment for this to actually impliment it as a language feature.
Plus, you usually can find a way around it anyway :). But basically, if your
interest in byte and char are for conserving memory then dont be worried...
PHP does a fairly good job with your memory and this wouldent actually
translate into a memory savings on the machine.

mainly it was for the strictness and for the extra speed gained by having a primitive at php level, to implement using say class Byte (which I have done) is seriously heavy processor and memory wise for something so simple.. especially if you consider an implementation of ByteArray..

obviously there isn't much call otherwise this would have been implemented back at v4 or at least 5; however I for one would love to see this simple little bit of support added.

Would open up masses of avenues, including the ability to make some decent orm's for php (much easier to map "byte to byte" than "scalar might be a byte but is really an integer to byte" if you know what I mean.

regards!

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to