From 9bbf5577dd828302ab9717f383eaf574eb798630 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Mon, 21 Jul 2003 11:48:37 +0000 Subject: [PATCH] Add a couple of tests --- tests/lang/036.phpt | 27 +++++++++++++++++++++++++++ tests/lang/037.phpt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 tests/lang/036.phpt create mode 100755 tests/lang/037.phpt 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-- +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-- +displayChild(); + } +}; + +class chld extends par { + private $id = "bar"; + + function displayChild() + { + print $this->id; + } +}; + + +$obj = new chld(); +$obj->displayMe(); + +?> +--EXPECT-- +bar -- 2.50.1