|
Posted by Rik on 08/14/07 21:06
On Tue, 14 Aug 2007 23:01:54 +0200, Water Cooler v2 <wtr_clr@yahoo.com> =
=
wrote:
>> 2. Constants are always in scope.
>
> You mean I can't have a global constant? Hmm! There's no syntax for
> it.
No, exactly the opposite: constants are kind of 'superglobals': they are=
=
always in scope, in every include, function, method etc. they can be use=
d.
<?php
define('FOO','bar');
$foz =3D 'baz';
function test(){
echo FOO;
echo $foz;
}
test();
?>
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|