mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
18 lines
399 B
PHP
18 lines
399 B
PHP
--TEST--
|
|
Referencing trait constants directly on calling \constant() causes a fatal error
|
|
--FILE--
|
|
<?php
|
|
|
|
trait TestTrait {
|
|
public const Constant = 42;
|
|
}
|
|
|
|
var_dump(\constant('TestTrait::Constant'));
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Cannot access trait constant TestTrait::Constant directly in %s:%d
|
|
Stack trace:
|
|
#0 %s: constant('TestTrait::Cons...')
|
|
#1 {main}
|
|
thrown in %s on line %d
|