Skip to content

Commit b4e9d9a

Browse files
committed
Test deprecated class constants as part of constant expressions
1 parent ea9c9dc commit b4e9d9a

File tree

1 file changed

+23
-0
lines changed
  • Zend/tests/attributes/deprecated/class_constants

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
#[\Deprecated]: Using the value of a deprecated class constant in a constant expression.
3+
--FILE--
4+
<?php
5+
6+
class Clazz {
7+
#[\Deprecated("prefix")]
8+
public const PREFIX = "prefix";
9+
10+
#[\Deprecated("suffix")]
11+
public const SUFFIX = "suffix";
12+
13+
public const CONSTANT = self::PREFIX . self::SUFFIX;
14+
}
15+
16+
var_dump(Clazz::CONSTANT);
17+
18+
?>
19+
--EXPECTF--
20+
Deprecated: Constant Clazz::PREFIX is deprecated, prefix in %s on line %d
21+
22+
Deprecated: Constant Clazz::SUFFIX is deprecated, suffix in %s on line %d
23+
string(12) "prefixsuffix"

0 commit comments

Comments
 (0)