From 9543a3e64d6bf62337fe2056234bd249f9ed99fc Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Tue, 10 Jun 2003 04:30:35 +0000 Subject: [PATCH] Clarify what it means to use undefined constants. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@130821 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/constants.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/language/constants.xml b/language/constants.xml index dc7da1bbcb..f622ca90b3 100644 --- a/language/constants.xml +++ b/language/constants.xml @@ -1,5 +1,5 @@ - + Constants @@ -66,10 +66,14 @@ If you use an undefined constant, PHP assumes that you mean - the name of the constant itself. A - notice will be issued - when this happens. Use the defined-function if - you want to know if a constant is set. + the name of the constant itself, just as if you called it as + a string (CONSTANT vs "CONSTANT"). An error of level + E_NOTICE will be issued + when this happens. See also the manual entry on why + $foo[bar] is + wrong (unless you first define + bar as a constant). If you simply want to check if a + constant is set, use the defined function. These are the differences between constants and variables: