diff options
author | Robin Fernandes <robinf@php.net> | 2008-01-30 14:29:19 +0000 |
---|---|---|
committer | Robin Fernandes <robinf@php.net> | 2008-01-30 14:29:19 +0000 |
commit | 4e210ade9389a5f3949ec73257ab1bad6baafd6b (patch) | |
tree | 9993184497eae9bd72dd9ae2450ac9feed53fae1 /tests/classes/property_override_protected_privateStatic.phpt | |
parent | f3643b59a52c964734864574b0f782fff51469b9 (diff) | |
download | php-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_privateStatic.phpt')
-rw-r--r-- | tests/classes/property_override_protected_privateStatic.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/classes/property_override_protected_privateStatic.phpt b/tests/classes/property_override_protected_privateStatic.phpt new file mode 100644 index 0000000000..fb7102cb3e --- /dev/null +++ b/tests/classes/property_override_protected_privateStatic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected property as private static. +--FILE-- +<?php + class A + { + protected $p = "A::p"; + function showA() + { + echo $this->p . "\n"; + } + } + + class B extends A + { + private 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 |