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

DevShed:
Implementing Property Overloading in PHP 4
July 11, 2006 @ 09:13:31

There's been a lot of fuss about the new object model in PHP5 lately, but what's a developer to do when he's stuck back in PHP4 and has no control over when things are updated? Do you just miss out on some of those cool features? Well, you may not have access to what PHP5-ers do, but PHP4 still has some cool tricks up its sleeve. One of which is property overloading, and it's covered in this new article from DevShed.

In these articles, I'll explain the basics of class overloading, starting with the application of the "overload()" function in PHP 4, in conjunction with using the "_set()", "__get()" and "__call()" methods, accompanied of several practical examples, so you'll have a clear idea of how to overload your classes. Also, I'll cover class overloading in PHP 5, which offers native support for overloading methods and properties through the built-in methods that I mentioned before.

This first part of the series lays down the groundwork of overloading, touching briefly on its uses before moving onto some of the functionality - the __set method, overload function, and __get method - to make a simple "cookie saver" application.

1 comment voice your opinion now!
overload php4 php5 property __set __get tutorial overload php4 php5 property __set __get tutorial


blog comments powered by Disqus

Similar Posts

Nikita Popov: How to add new (syntactic) features to PHP

Zend Developer Zone: phpPaypalPro version 0.1.0 has been released

DevShed: The Switch Statement and Arrays

DevShed: The Autoload Magic Function in PHP 5

Brandon Savage's Blog: Installing PHP 5.3 On Ubuntu


Community Events











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


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

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