mirror of
https://github.com/php/php-src.git
synced 2024-12-19 06:50:17 +08:00
7ce531f2c2
This means we get an Error exception and a much better error message indicating the root cause (e.g. accessing a private class constant).
18 lines
275 B
PHP
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'
|