summaryrefslogtreecommitdiff
path: root/tests/lang/036.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang/036.phpt')
-rw-r--r--tests/lang/036.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/lang/036.phpt b/tests/lang/036.phpt
new file mode 100644
index 0000000..474316e
--- /dev/null
+++ b/tests/lang/036.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Child public element should not override parent private element in parent methods
+--FILE--
+<?php
+class par {
+ private $id = "foo";
+
+ function displayMe()
+ {
+ print $this->id;
+ }
+};
+
+class chld extends par {
+ public $id = "bar";
+ function displayHim()
+ {
+ parent::displayMe();
+ }
+};
+
+
+$obj = new chld();
+$obj->displayHim();
+?>
+--EXPECT--
+foo