summaryrefslogtreecommitdiff
path: root/tests/classes/property_override_protected_protectedStatic.phpt
diff options
context:
space:
mode:
authorRobin Fernandes <robinf@php.net>2008-01-30 14:29:19 +0000
committerRobin Fernandes <robinf@php.net>2008-01-30 14:29:19 +0000
commit4e210ade9389a5f3949ec73257ab1bad6baafd6b (patch)
tree9993184497eae9bd72dd9ae2450ac9feed53fae1 /tests/classes/property_override_protected_protectedStatic.phpt
parentf3643b59a52c964734864574b0f782fff51469b9 (diff)
downloadphp-git-4e210ade9389a5f3949ec73257ab1bad6baafd6b.tar.gz
Adding tests for class features, including __autoload(), property inheritance rules and class constants. Note: autoload_012.phpt failing on php6, fix expected via bug 43973.
Diffstat (limited to 'tests/classes/property_override_protected_protectedStatic.phpt')
-rw-r--r--tests/classes/property_override_protected_protectedStatic.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/classes/property_override_protected_protectedStatic.phpt b/tests/classes/property_override_protected_protectedStatic.phpt
new file mode 100644
index 0000000000..1ce4130265
--- /dev/null
+++ b/tests/classes/property_override_protected_protectedStatic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected property as protected static.
+--FILE--
+<?php
+ class A
+ {
+ protected $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18