diff options
author | Robin Fernandes <robinf@php.net> | 2008-01-30 14:25:57 +0000 |
---|---|---|
committer | Robin Fernandes <robinf@php.net> | 2008-01-30 14:25:57 +0000 |
commit | 7eb114a9cf19e585be1a0075f5b1275a40d68e91 (patch) | |
tree | f6ca9f65deb757efca4406c18041569f3cce2710 /tests/classes/constants_basic_006.phpt | |
parent | b9df996a3b372a869a9e30cb02d45ac63e031450 (diff) | |
download | php-git-7eb114a9cf19e585be1a0075f5b1275a40d68e91.tar.gz |
Adding tests for class features, including __autoload(), property inheritance rules and class constants.
Diffstat (limited to 'tests/classes/constants_basic_006.phpt')
-rw-r--r-- | tests/classes/constants_basic_006.phpt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/classes/constants_basic_006.phpt b/tests/classes/constants_basic_006.phpt new file mode 100644 index 0000000000..73cf0ef3a9 --- /dev/null +++ b/tests/classes/constants_basic_006.phpt @@ -0,0 +1,43 @@ +--TEST-- +Ensure class constants are not evaluated when a class is looked up to resolve inheritance during runtime. +--FILE-- +<?php + class C + { + const X = E::A; + public static $a = array(K => D::V, E::A => K); + } + + eval('class D extends C { const V = \'test\'; }'); + + class E extends D + { + const A = "hello"; + } + + define('K', "nasty"); + + var_dump(C::X, C::$a, D::X, D::$a, E::X, E::$a); +?> +--EXPECTF-- +string(5) "hello" +array(2) { + ["nasty"]=> + string(4) "test" + ["hello"]=> + string(5) "nasty" +} +string(5) "hello" +array(2) { + ["nasty"]=> + string(4) "test" + ["hello"]=> + string(5) "nasty" +} +string(5) "hello" +array(2) { + ["nasty"]=> + string(4) "test" + ["hello"]=> + string(5) "nasty" +} |