PHP
  Home arrow PHP arrow Understanding Static Properties with P...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
eWeek
 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

Understanding Static Properties with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2007-09-12

    Table of Contents:
  • Understanding Static Properties with PHP 5
  • Reintroducing a previous hands-on example
  • Defining static properties within PHP 5 classes
  • Demonstrating the functionality of a static property

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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

    PCmover - $15 Off with Coupon Code CJPH7Q

    Understanding Static Properties with PHP 5
    (Page 1 of 4 )

    The powerful object model offered by PHP 5 presents some useful features that are quite frequently underestimated by the average PHP developer. This is precisely the case with using static methods and properties in conjunction with the object-oriented paradigm, thus if you're interested in learning how to put static data to work for you, then this series of articles might be what you're looking for.

    Introduction

    Welcome to the second part of the series that began with "Handling Static Data with PHP 5". As you might guess, this series shows you how to take advantage of defining static properties and methods with PHP 5 classes, and it complements the corresponding theoretical concepts with several illustrative hands-on examples.

    If you already went through the first article of the series, then it's quite possible that working with static data in PHP 5 is now a familiar concept to you. In that tutorial, I demonstrated, by way of a few simple (yet functional) examples, how to use a static method to implement the factory pattern. In truth, the definition and further utilization of a static method within a factory class can be considered almost a rule of thumb when it comes to factoring different objects during a the execution of a given PHP application.

    The subject, however, goes by far beyond defining a static method as part of a simple factory class. And I'm saying this because admittedly, working with static data in PHP 5 might be incredibly useful in certain cases, a fact that you might not have been aware of until now. Thus, provided that you already have an average background in using static methods with PHP 5, over the course of this second article of the series I'll dive a bit deeper into this interesting  topic and show you how to take advantage of static properties defined inside a given PHP class, in this manner completing, at least basically, the implementation of static data with PHP 5.

    Even though the term "static" sounds like it refers to a thing that does nothing, in the new few lines you'll be hopefully surprised at the great range of PHP applications that can incorporate the remarkable benefits of using static properties in their classes.

    Having introduced the subject of this second installment of the series, it's time to step forward and continue learning with more examples of how to use static properties with PHP 5. It's going to be an educational journey, trust me!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this second installment of the series, you'll learn the core...
     

       

    PHP ARTICLES

    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5
    - Working with Multiple Document Nodes with th...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway