]> granicus.if.org Git - php/commitdiff
Maintain ZEND_CHANGES to account for the addition of private member variables.
authorSebastian Bergmann <sebastian@php.net>
Thu, 21 Feb 2002 13:10:31 +0000 (13:10 +0000)
committerSebastian Bergmann <sebastian@php.net>
Thu, 21 Feb 2002 13:10:31 +0000 (13:10 +0000)
Zend/ZEND_CHANGES

index f17f4e30032066739e7013b1cd44554c4837a81d..80f0604eb3e4db1499f0ff97da00030cac07ba89 100644 (file)
@@ -28,6 +28,39 @@ Changes in the Zend Engine 2.0
       gradually migrate to the behavior of the Zend Engine 2 (without
       automatic clones).
 
+    * Private Members.
+
+      The Zend Engine 2.0 introduces private member variables. Note
+      that for performance reasons no error message is emitted in
+      case of an illegal access to a private member variable.
+
+      Example:
+
+        <?php
+        class MyClass {
+          private $Hello = "Hello, World!\n";
+
+          function printHello() {
+            print $this->Hello;
+          }
+        }
+
+        class MyClass2 extends MyClass {
+          function printHello() {
+            MyClass::printHello(); /* Should print */
+            print $this->Hello;    /* Shouldn't print out anything */
+          }
+        }
+
+        $obj = new MyClass();
+        print $obj->Hello;  /* Shouldn't print out anything */
+        $obj->printHello(); /* Should print */
+
+        $obj = new MyClass2();
+        print $obj->Hello;  /* Shouldn't print out anything */
+        $obj->printHello();
+        ?>
+
     * Object Cloning
 
       The Zend Engine 1.0 offered no way a user could decide what copy