note 7997 deleted from language.variables.scope by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 21:46:53 +0000 |
| Subject: | note 7997 deleted from language.variables.scope by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22237@lists.php.net to get a copy of this message | ||
What needs documenting is how scoping applies to the HTML-interpolatedness of PHP.
<?php
$a = 'foo';
$b = 'bar';
?>
text text text plain ol' HTML text
<?php
echo $a . $b;
?>
So will this echo statement return "foobar" or "" ?
It turns out that the former is correct: "global" means the entire file, not just that
particular chunk of PHP within the file. Which only makes sense, given the examples of ASP and
JavaScript, but it needs saying.