PHP
  Home arrow PHP arrow The Call Magic Function in PHP 5
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

The Call Magic Function in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2009-06-08


    Table of Contents:
  • The Call Magic Function in PHP 5
  • Review: the isset and unset magic functions
  • Method overloading in PHP 5 with the call magic function
  • The call magic method in action

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    The Call Magic Function in PHP 5
    ( Page 1 of 4 )

    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.

    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
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT