Re: note 8966 added to define
| From: | J. M. Castagnetto | Date: | Mon, 09 Oct 2000 23:27:10 +0000 |
| Subject: | Re: note 8966 added to define | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6271@lists.php.net to get a copy of this message | ||
Very strange, the following trivial code works w/o
problems:
[definc.php]
<?php
define (YEAR, "2000");
?>
[def.php]
<?php
include("definc.php");
function foo () {
echo "Year: ".YEAR."\n";
}
foo();
?>
When you run "def.php" it prints:
Year: 2000
as it should.
Your note has been removed. Next time bug reports
should go to bugs.php.net, and for support see
www.php.net/support.php, do not use the Manual Notes
for this purpose.
--- jpreece@caprock.com wrote:
> The documentation states that "Constants may be
> accessed anywhere without regard to variable scoping
> rules;" but I'm dubious. I have defined a constant
> in an included file and successfully referenced it
> in the parent file. However, if I try to reference
> this constant inside any functions...no dice. Any
> suggestions?
>
> http://www.php.net/manual/function.define.php
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-notes-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-notes-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/