A Path Less Taken

Breaking with convention in a very conventional fashion. Powered by WordPress

"What would you attempt to do if you knew you could not fail?"
Dr. Robert Schuller

Friday, December 4, 2009

Category: PHP Development Tags: Author: JJ 0 Comments

In a recent post by David Walsh I noticed an interesting and helpful description of the PHP “Magic Method” __call. In his post Create PHP Classes with Dynamic Functions David outlines how to use __call to act as a generic get method. Since I have seen these before I jumped to the PHP 5 documentation on Magic Methods to refresh my memory. I realized that I have never used the __get and __set methods in my development. I know many will argue that these are dangerous methods, but I think there could be some situations where they could be properly implemented to ease your coding practices. Have a look and let me know what you think about them.

No comments found. Please enter a comment if you have a question or contribution.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">