From: Marcus Boerger Date: Mon, 20 Oct 2003 10:06:31 +0000 (+0000) Subject: Update X-Git-Tag: RELEASE_1_3b3~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=445aa744e7908e90f04e59787bf2e2e684f49f0e;p=php Update --- diff --git a/Zend/ZEND_CHANGES b/Zend/ZEND_CHANGES index 68f96a0d19..6a7b7c2fad 100644 --- a/Zend/ZEND_CHANGES +++ b/Zend/ZEND_CHANGES @@ -125,7 +125,8 @@ Changes in the Zend Engine 2.0 $o->test(); ?> - Abstract classes cannot be instantiated. + Abstract classes cannot be instantiated and must not contain + abstract methods. Old code that has no user-defined classes or functions named 'abstract' should run without modifications. @@ -205,11 +206,11 @@ Changes in the Zend Engine 2.0 This syntax only applies to objects/classes, not built-in types. - * final. + * Final methods and classes. The Zend Engine 2.0 introduces the "final" keyword to declare final members and methods. Those cannot be overridden by - sub-classes. + sub-classes. Example: @@ -221,6 +222,23 @@ Changes in the Zend Engine 2.0 } ?> + It is furthermore possible to make a class final. Doing this + prevents a class from being specialized (it cannot be inherited + by another class). There's no need to declare the methods of + a final class themselves as final. + + Example: + + + + Properties cannot be final. + Old code that has no user-defined classes or functions named 'final' should run without modifications. @@ -474,8 +492,7 @@ Changes in the Zend Engine 2.0 ShapeFactoryMethod('Square')->draw(); ?> - * Static member variables of static classes can now be - initialized. + * Static member variables of classes can now be initialized. Example: @@ -606,6 +623,86 @@ Changes in the Zend Engine 2.0 var_dump($a); ?> + * Iteration + + Objects may be iterated in an overloaded way when used with + foreach. The default behavior is to iterate over all properties. + + Example: + + $prop_value) { + // using the property + } + ?> + + TBD: Respect visibility: Show protected only when inside class + method and only otherwise public properties only. + + * __METHOD__ + + The pseudo constant __METHOD__ shows the current class and method + when used inside a method and the function when used outside of a + class. + + Example: + + + + * __toString() + + The magic method __toString() allows to overload the object to + string conversion. + + Example: + + + + * Reflection + + Nearly all aspects of object oriented code can be reflected by + using the reflection API which is documented separatley: + http://sitten-polizei.de/php/reflection_api/docs/language.reflection.html + + Example: + + + + Changes in the Zend Engine 1.0