summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2003-07-21 11:48:37 +0000
committerZeev Suraski <zeev@php.net>2003-07-21 11:48:37 +0000
commit9bbf5577dd828302ab9717f383eaf574eb798630 (patch)
treee30f05eb9a57f47d1986ffa526f720b1d271bd90 /tests
parenteede10964f334b3eaab8ac8cf21710600b9e13a5 (diff)
downloadphp-git-9bbf5577dd828302ab9717f383eaf574eb798630.tar.gz
Add a couple of tests
Diffstat (limited to 'tests')
-rwxr-xr-xtests/lang/036.phpt27
-rwxr-xr-xtests/lang/037.phpt30
2 files changed, 57 insertions, 0 deletions
diff --git a/tests/lang/036.phpt b/tests/lang/036.phpt
new file mode 100755
index 0000000000..474316e363
--- /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
diff --git a/tests/lang/037.phpt b/tests/lang/037.phpt
new file mode 100755
index 0000000000..c2a1ee312f
--- /dev/null
+++ b/tests/lang/037.phpt
@@ -0,0 +1,30 @@
+--TEST--
+'Static' binding for private variables
+--FILE--
+<?php
+
+class par {
+ private $id="foo";
+
+ function displayMe()
+ {
+ $this->displayChild();
+ }
+};
+
+class chld extends par {
+ private $id = "bar";
+
+ function displayChild()
+ {
+ print $this->id;
+ }
+};
+
+
+$obj = new chld();
+$obj->displayMe();
+
+?>
+--EXPECT--
+bar