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

Greg Beaver's Blog:
PHP namespaces become much better (Derick take note)
June 23, 2008 @ 11:19:27

Greg Beaver, noting some issues that Derick Rethans had pointed out about namespace support for upcoming PHP versions, has posted about a patch he submitted to solve the problem simply.

The issue Derick pointed out:

In PHP 5.3 this would alias the class Interval in the namespace PEAR::Date to the class Interval. For now, this code would work just fine. However, if PHP would introduce a class "Interval" at some point in the future (and PHP can do this as it owns the global namespace) then the above code would suddenly stop working.

Greg's patch makes it possible to "override" the internal class if need be, making it so that code currently working wouldn't break. All it takes is to "use" is like you normally would and and the magic happens behind the scenes.

0 comments voice your opinion now!
namespace override internal class instance patch php5


blog comments powered by Disqus

Similar Posts

DevShed: Working with Prepared Queries with PDO Objects in PHP 5

HowTo Forge: How To Harden PHP5 With Suhosin (Debian Etch/Ubuntu)

DevShed: Building an Image Generator Class with PHP 5

Maarten Balliauw's Blog: Office 2007 SpreadsheetML classes in PHP

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 7)


Community Events











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


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

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