News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Chris Tankersley's Blog:
Getting Started with Reflection
September 03, 2010 @ 14:12:13

Chris Tankersley has a new post to how blog looking at a powerful but sometimes seldom used feature of PHP - Reflection. His post introduces you to some of the basics you can use to have your code find out more about itself.

Reflection is a metaprogramming construct that allows a program to look into itself and do a multitude of different things - gain meaning, watch execution, call code, or even provide feedback. [...] With PHP 5, PHP gained a robust reflection class that allows a developer to gain access to just about every aspect of an object and interact with it. The key is figuring out what is available, and then exploiting it to gain additional benefits.

He gives examples from his project where it uses the ReflectionClass feature to pull in the values of a class including properties and methods in a class (a set of ReflectionMethods). Some code is provided to make the examples a bit more clear.

1 comment voice your opinion now!
reflection introduction tutorial reflectionclass reflectionmethod


blog comments powered by Disqus

Similar Posts

php|architect: Rich Internet Applications With PHP and Flex (Part 2)

Content with Style: Fulltext searches with Xapian and PHP

MakeBeta Blog: Facebook PHP Tutorial

Dagfinn Reiersol's Blog: Real programming with PHP 5.3 (part 4): A more realistic example

RIA Zone: Charting data from a database using Adobe Flex and PHP


Community Events











Don't see your event here?
Let us know!


application hack overview example symfony2 introduction language framework component hhvm facebook opinion install package release security podcast composer unittest code

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework