mirror of
https://github.com/php/php-src.git
synced 2026-04-29 11:13:36 +02:00
d30cd7d7e7
Closes GH-5590
17 lines
309 B
PHP
17 lines
309 B
PHP
--TEST--
|
|
Bug #72920 (Accessing a private constant using constant() creates an exception AND warning)
|
|
--FILE--
|
|
<?php
|
|
class Foo {
|
|
private const C1 = "a";
|
|
}
|
|
|
|
try {
|
|
var_dump(constant('Foo::C1'));
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Cannot access private constant Foo::C1
|