News Feed
Sections
News Archive


Community Events






feed this:

PHPEverywhere:
Octalpussy
0 comments :: posted Monday February 04, 2008 @ 10:25:00
voice your opinion now!

In an earlier post John Lim pointed out an interesting issue with how certain numbers are handled in PHP - ones starting with a zero:

That's because any number preceded by 0 is treated as an octal number, and 9 is an invalid octal number. [...] The silly thing is that hardly anyone uses octal nowadays, but it continues to be part of the C, C++, Java and PHP standards. The mistake is also very common.

There's not much way around it, he notes - the format's been in use for a long time now and is so ingrained in just about every C-based language out there that it's "too deeply imprinted in modern compiler DNA" to take out.

tagged with: octal number bug base8 adodb



book application releases security release developer zendframework PEAR code framework job database zend ajax package mysql PHP5 pecl cakephp conference

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework