Home arrow PHP arrow The Call Magic Function in PHP 5

The Call Magic Function in PHP 5

If you’re a PHP developer who wishes to learn how to implement and use the set of magic functions that come included with PHP 5, you’ve come to the right place. Welcome to the third part of a series that takes a close look at magic functions in PHP 5. Made up of seven tutorials, this series teaches you how to work with the most common PHP 5 magic functions, putting particular emphasis on their usage within the context of object-oriented applications.

  1. The Call Magic Function in PHP 5
  2. Review: the isset and unset magic functions
  3. Method overloading in PHP 5 with the call magic function
  4. The call magic method in action
By: Alejandro Gervasio
Rating: starstarstarstarstar / 6
June 08, 2009

print this article



And now that you know what to expect from this group of articles, it's time to quickly review the topics that were discussed in the last one. In that installment of the series I explained by means of some examples how to work with the complementary "__isset()" and "__unset()" magic methods, which are called automatically by the PHP engine when using the "isset()" and "unset()" functions respectively.

Frankly speaking, those magic methods aren't the most useful provided by PHP 5, but there are others that do allow you to perform powerful tasks with minor efforts. That's exactly the case with the "__call()" function, which is invoked transparently by the PHP interpreter when a non-existent method of a class is called by a script.

As I said before, this function permits you to do all sorts of clever things, ranging from creating setters and getters on the fly to building mechanisms that catch calls to other defined class methods.

Therefore, as the title of this article suggests, in the new few lines I'm going to take a deeper look at the"__call()" function, so that you can quickly become familiar with it. 

Are you ready to learn how to take advantage of this handy magic function? Then begin reading right now!

>>> More PHP Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: