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.
I too would love to see more type hinting :). ~Graham Kelly On Wed, Dec 17, 2008 at 5:57 PM, Nathan Rixham <nrix...@gmail.com> wrote: > Don't want to take up much of you're time, just wondered if anybody could > point me to the reason why some primitives aren't in php. > > Would find it very very useful to have byte, short, long, float, double and > char in php. (primarily byte and char). > > while I'm here I may as well also ask about further adding type hinting for > the existing scalars and array. > > and finally different method signatures such as: > > class Whatever { > public function __construct(Bar b); > public function __construct(Foo f); > public function doSomething(Bar b); > public function doSomething(Foo f); > } > > Regards! > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >