News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPEverywhere:
Octalpussy
February 04, 2008 @ 10:25:00

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.

0 comments voice your opinion now!
octal number bug base8 adodb


blog comments powered by Disqus

Similar Posts

Ed Finkler's Blog: Bug in Zend Studio 5.5ís php.ini

PHPClasses.org: Lately in PHP Episode 15 - PHP 5.3.8 Upgrade, PHP 5.4 beta, Wrong Ideas About PHP

Pierre-Alain Joye's Blog: ext/filter, API frozen (!) and fixes, 0.11.0 is out

Zend Developer Zone: Announcing the August 2011 Zend Framework Bug-Hunt

Kore Nordmann's Blog: Evil bugs in your code


Community Events











Don't see your event here?
Let us know!


release language podcast framework introduction facebook hack application hhvm unittest composer install performance opinion database security series component package symfony2

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