From 0e17eea049ba7c77351d2166e89524388922ce80 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 7 Mar 2002 10:31:51 +0000 Subject: [PATCH] Add another 'import' example and merge 'import' section into 'Namespaces' section. --- Zend/ZEND_CHANGES | 62 +++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/Zend/ZEND_CHANGES b/Zend/ZEND_CHANGES index 8454f6feac..7e2d90cbbc 100644 --- a/Zend/ZEND_CHANGES +++ b/Zend/ZEND_CHANGES @@ -160,8 +160,7 @@ Changes in the Zend Engine 2.0 defaulting to the current global one. The current namespace may be changed on a file-by-file basis. Symbols in other namespaces than the current one may be referenced using a new namespace - operator. It is possible to "import" symbols from one namespace - into another. + operator. Namespaces and classes are the same with the Zend Engine 2.0, except that you can't instantiate a namespace with "new". This @@ -256,36 +255,53 @@ Changes in the Zend Engine 2.0 This prints "foobar" two times, since a bar() method exists in the current namespace. - Old code that does not take advantage of namespaces will run - without modifications. + * It is possible to "import" symbols from one namespace into + another. - * import statement. + Example: - With the new import statement it is possible to import classes - and methods from other classes (namespaces) to the current scope. + + + Example: - class MyClass2 { - function hello() { - print "Hello, World in MyClass2\n"; + + MyInnerClass::func1(); + func2(); + ?> - Old code that has no user-defined function 'import' will run + Old code that does not take advantage of namespaces will run without modifications. * Unified Constructors. -- 2.40.0