From b03b79c985789d1a8bf182edc4b67e833c6427e3 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 18 May 2005 14:56:34 +0000 Subject: [PATCH] tests --- Zend/tests/bug29689.phpt | 57 ++++++++++++++++++++++++++++++++++++++++ Zend/tests/bug30451.phpt | 36 +++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 Zend/tests/bug29689.phpt create mode 100644 Zend/tests/bug30451.phpt diff --git a/Zend/tests/bug29689.phpt b/Zend/tests/bug29689.phpt new file mode 100644 index 0000000000..003499f378 --- /dev/null +++ b/Zend/tests/bug29689.phpt @@ -0,0 +1,57 @@ +--TEST-- +Bug #29689 (default value of protected member overrides default value of private) +--FILE-- +foo, "\n"; + } +} + +class bar extends foo { + protected $foo = 'bar'; + + function printFoo() + { + parent::printFoo(); + echo __CLASS__, ': ', $this->foo, "\n"; + } +} + +class baz extends bar { + protected $foo = 'baz'; +} + +class bar2 extends foo { + function printFoo() + { + parent::printFoo(); + echo __CLASS__, ': ', $this->foo, "\n"; + } +} + +class baz2 extends bar2 { + protected $foo = 'baz2'; +} + +$bar = new bar; +$bar->printFoo(); +echo "---\n"; +$baz = new baz(); +$baz->printFoo(); +echo "---\n"; +$baz = new baz2(); +$baz->printFoo(); +?> +--EXPECT-- +foo: foo +bar: bar +--- +foo: foo +bar: baz +--- +foo: foo +bar2: baz2 diff --git a/Zend/tests/bug30451.phpt b/Zend/tests/bug30451.phpt new file mode 100644 index 0000000000..210f087574 --- /dev/null +++ b/Zend/tests/bug30451.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #30451 (static properties permissions broken) +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) -- 2.40.0