php-src/Zend/tests/bug51791.phpt
Nikita Popov 7ce531f2c2 Make constant() error handling consistent with plain const lookup
This means we get an Error exception and a much better error
message indicating the root cause (e.g. accessing a private class
constant).
2020-01-10 13:39:56 +01:00

18 lines
275 B
PHP

--TEST--
Bug #51791 (constant() failed to check undefined constant and php interpreter stopped)
--FILE--
<?php
class A {
const B = 1;
}
try {
constant('A::B1');
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Undefined class constant 'A::B1'