Meta Programming and Reection in PHP
A meta program is a program, which has other programs or
even itself as its application domain. This technique is commonly used to
implement advanced software development tools and frameworks. PHP
is one of the most popular programming languages for web applications ...
The programming language in focus of this paper will be PHP, which is one of
the most popular programming languages for web applications. Like many other
languages PHP provides a set of meta programming and reï¬ ection facilities.
This paper gives an overview of these capabilities and discusses stregnths and
weaknesses of their implementation. In our earlier work we already developed.
The remainder of this paper is structured as follows: In the following section,
the dynamic scripting language PHP is presented. This includes its history, do-
mains of application, and also its special features in section 2.2. Then, in the
context of meta programming, the basic reï¬ ection features, such as the histori-
cally grown procedural API and its object-oriented reï¬ ection API, are presented
in section 3.1. Here, the design decisions taken to build the object-oriented part
in its own subsystem are emphasized. Afterward, a short overview about the com-
mon usage of reï¬ ection in the PHP community is given. Section 3.3 introduces
our implementation of an annotation mechanism, which is one of the common
use cases the reï¬ ection API is used for. The main contribution of our current
work is presented in section 3.4. It is a prototype of a class browser utilizing the
PHPâ s reï¬ ection capabilities to its limits. How intercession is possible in PHP
is shown in section 4.1, including the presentation of the Runkit extension and
some further extensions for meta programming in general.
In modern programming languages a typical way to obtain structural information
is to leverage the runtime environment of the language and access language
elements through a high level reï¬ ection API.
...
Source: instantsvc.sourceforge.net

Topic: