mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
d30cd7d7e7
Closes GH-5590
25 lines
340 B
PHP
25 lines
340 B
PHP
--TEST--
|
|
constant() tests
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
var_dump(constant(""));
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
define("TEST_CONST", 1);
|
|
var_dump(constant("TEST_CONST"));
|
|
|
|
define("TEST_CONST2", "test");
|
|
var_dump(constant("TEST_CONST2"));
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECT--
|
|
Undefined constant ""
|
|
int(1)
|
|
string(4) "test"
|
|
Done
|