Home arrow PHP arrow Checking Native and User-Defined Classes with the Reflection API

Checking Native and User-Defined Classes with the Reflection API

Welcome to the final part of a series on the Reflection API. Through a decent variety of functional code samples, this series shows you how to take advantage of the power offered by reflection to analyze the internal structure of your classes and interfaces by using an object-oriented approach.

  1. Checking Native and User-Defined Classes with the Reflection API
  2. Review: a quick look at some previous examples
  3. Working with the isInternal() method
  4. Checking native and user-defined classes with the isUserDefined() reflective method
By: Alejandro Gervasio
Rating: starstarstarstarstar / 2
April 05, 2010

print this article



And now that you've been introduced to the main goal of this series, I'd like to spend a few moments refreshing the topics that were covered in the last article. In that tutorial I explained how to utilize a couple of methods included with the reflection API to determine if a specified class was declared abstract or final (or both) and if the class in question implemented a specified interface.

All of these reflective tasks were carried out by means of a clean object-oriented interface, which made the whole introspection process easy. Besides, the reflection API comes with many other handy methods that allow you to perform all sorts of reverse engineering processes on a given class. There are so many, in fact, that they can't all be covered in this series.

In this last tutorial, however,  I'm going to explain how to use reflection to find out whether a specific class is native or user-defined. And, if that's not good enough for you, you'll also learn whether the class can be traversed via a "foreach" construct.

Ready to tackle the final chapter of this educational journey on exploring the PHP 5 reflection API? Then start 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: