1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/Zend/tests/constants/dynamic_class_const_fetch_const_expr.phpt
DanielEScherzer a50f82bebf Zend/tests: organize some tests with sub directories (6) (#17807)
Move more tests into existing directories

Work towards GH-15631
2025-02-15 14:55:07 +00:00

25 lines
455 B
PHP

--TEST--
Dynamic class constant fetch in constant expressions
--FILE--
<?php
class Foo {
public const BAR = 'bar';
public const BA = 'BA';
public const R = 'R';
public const CLASS_ = 'class';
public const A = self::{'BAR'};
public const B = self::{'BA' . 'R'};
public const C = self::{self::BA . self::R};
}
var_dump(Foo::A);
var_dump(Foo::B);
var_dump(Foo::C);
?>
--EXPECT--
string(3) "bar"
string(3) "bar"
string(3) "bar"