Ability to fully qualify class namesScope of ChangeClasses can be optionally declared with their fully qualified name. Class loading and reflection semantics will not change, though. Rationale
Avoid name clashes. Especially useful for supporting classes that never
appear in a new statement or any other place their full name needs to be
typed, like remote interfaces. Functionality
A class declares being within a package by setting the variable $package. Example (Declaration)
uses('util.Date');
Example (Usage)
require('lang.base.php');
Output of above example
More Power: Fri, 02 Sep 2005 17:59:44 +0200
Notes
- For existing classes, nothing will change
- Fully qualified classes can only be referenced by their fully qualified
name, non-fully-qualified classes can only be referenced by their non-
qualified name
- XPClass::forName() can no longer support unqualified class names. What
does XPClass::forName('Date') return for the above example?
Security considerations
n/a Speed impactCore will become a bit slower because it will need to distinguish between the two cases:
DependenciesNote: This will change the version number to 5.5.0
Related documents
- http://experiments.xp-framework.net/?arena,classloaders
Experiment Comments
- friebe, Fri Sep 2 18:08:18 CEST 2005
The patch still needs quite some work. All the array_search() /
in_array() calls to look up class names are slow. | Table of contents |