Re: cvs: phpdoc /en/language constants.xml

From: Date: Sun, 11 Jun 2006 21:39:37 +0000
Subject: Re: cvs: phpdoc /en/language constants.xml
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969373265@lists.php.net to get a copy of this message
> + it can never be changed or undefined. Unlike functions, constants need to > + be defined before they are referenced. This isn't _necessarily_ true. Example: sean@iconoclast:~$ php5 -r ' if (0) { function foo() { echo "foo"; } } foo();' Fatal error: Call to undefined function foo() in Command line code on line 1 I think this note should be moved to the define() page, and it should say something like: "define() defines a constant at runtime. If a script's execution never reaches the call to define(), the constant will not be defined." S

« previous php.doc (#969373265) next »