cvs: ZendEngine2 / ZEND_CHANGES
| From: | Sebastian Bergmann | Date: | Sat, 02 Mar 2002 22:24:46 +0000 |
| Subject: | cvs: ZendEngine2 / ZEND_CHANGES | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9603@lists.php.net to get a copy of this message | ||
sebastian Sat Mar 2 17:24:46 2002 EDT
Modified files:
/ZendEngine2 ZEND_CHANGES
Log:
Add 'import statement' section.
Index: ZendEngine2/ZEND_CHANGES
diff -u ZendEngine2/ZEND_CHANGES:1.18 ZendEngine2/ZEND_CHANGES:1.19
--- ZendEngine2/ZEND_CHANGES:1.18 Thu Feb 21 08:10:31 2002
+++ ZendEngine2/ZEND_CHANGES Sat Mar 2 17:24:46 2002
@@ -259,6 +259,35 @@
Old code that does not take advantage of namespaces will run
without modifications.
+ * import statement.
+
+ With the new import statement it is possible to import classes
+ and methods from other classes (namespaces) to the current scope.
+
+ Example:
+
+ <?php
+ class MyClass {
+ function hello() {
+ print "Hello, World\n";
+ }
+
+ class MyClass2 {
+ function hello() {
+ print "Hello, World in MyClass2\n";
+ }
+ }
+ }
+
+ import function hello, class MyClass2 from MyClass;
+
+ MyClass2::hello();
+ hello();
+ ?>
+
+ Old code that has no user-defined function 'import' will run
+ without modifications.
+
* Unified Constructors.
The Zend Engine allows developers to declare constructor methods