Examine PHP V5.3.0 features under the microscope | Linux Today

Examine PHP V5.3.0 features under the microscope

Written By
Web Webster
Web Webster
Nov 17, 2009

[ Thanks to An Anonymous Reader for
this link. ]

“Class method overloading

“The term overloading in PHP is a little different from the
usual object-oriented context. In the Java™ language or C#,
an “overloaded” method is one that provides code for a range of
different parameter lists. For example, if I have a method called
draw(String str), an overloaded version can have the following
form: draw(String str, int i). This use of the method symbol name
is referred to as the method signature and, for the purposes of
overloading, the return type is ignored.

“In PHP, “overloading” is used to refer to dynamically created
methods and properties. This is in effect dynamic code, and any
such dynamic entities are processed by what are called magic
methods. You can create these magic methods in a class for a
variety of action types. Then, the overloading methods are invoked
at the point in your code where you interact with undeclared or
invisible properties or methods. This style of language overloading
provides you with a substantial degree of flexibility.

“This all sounds complicated, so look at an example to make it
more concrete. Listing 4 illustrates using PHP overloading to
invoke object and class methods.”


Complete Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.