1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/attributes/constants/constant_redefined_addition.phpt

22 lines
431 B
PHP

--TEST--
If a constant is redefined, attributes remain unchanged (no attributes)
--FILE--
<?php
const MY_CONST = "No attributes";
#[\MyAttribute]
const MY_CONST = "Has attributes";
echo MY_CONST . "\n";
$reflection = new ReflectionConstant('MY_CONST');
var_dump($reflection->getAttributes())
?>
--EXPECTF--
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
No attributes
array(0) {
}