1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 13:31:27 +02:00
Files
archived-php-src/tests/classes/constants_visibility_002.phpt
DanielCiochiu 07877c46e3 Fixed bug #75546
By respecting the SILENT flag when checking the visibility of a
class constant.
2019-02-12 11:42:33 +01:00

25 lines
489 B
PHP

--TEST--
Class protected constant visibility
--FILE--
<?php
class A {
protected const protectedConst = 'protectedConst';
static function staticConstDump() {
var_dump(self::protectedConst);
}
function constDump() {
var_dump(self::protectedConst);
}
}
A::staticConstDump();
(new A())->constDump();
constant('A::protectedConst');
?>
--EXPECTF--
string(14) "protectedConst"
string(14) "protectedConst"
Warning: constant(): Couldn't find constant A::protectedConst in %s on line %d