/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/classes/constants_basic_006.phpt
43 строки
717 B
Gabriel Caruso
Trim trailing whitespace in tests
14 окт 2018, 18:07
Не верифицирован
14 окт 2018, 18:07
9c144e0
Код
Авторство
О чём код?
--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); ?> --EXPECT-- 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" }