note 109855 deleted from language.constants by aharvey
| From: | aharvey@php.net | Date: | Fri, 31 Aug 2012 06:46:33 +0000 |
| Subject: | note 109855 deleted from language.constants by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190295@lists.php.net to get a copy of this message | ||
Note Submitter: cHao
----
const works in the global scope as well (at least in PHP 5.3.3). Seems it didn't
work in 5.2, but has since been fixed. :)
<?php
const GREETING = "Hello, world!\n";
echo GREETING;
?>
Still can't use it in functions...but it does work in files *included* from functions. So that
script above? If you had a function that included it, it would still work -- and GREETING would be
visible to the rest of the app after the include.