mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Directly referring to a constant of an undefined throws an exception; there is not much point in `constant()` raising a fatal error in this case. Closes GH-9907.
25 lines
428 B
PHP
25 lines
428 B
PHP
--TEST--
|
|
Bug #44827 (Class error when trying to access :: as constant)
|
|
--CREDITS--
|
|
Sebastian Schürmann
|
|
sebs@php.net
|
|
Testfest Munich 2009
|
|
--FILE--
|
|
<?php
|
|
try {
|
|
define('::', true);
|
|
} catch (ValueError $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
constant('::');
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
define(): Argument #1 ($constant_name) cannot be a class constant
|
|
Class "" not found
|