|
Posted by Andy Jeffries on 05/16/06 11:09
On Mon, 15 May 2006 23:14:22 +0100, Tony Marston wrote:
>> And, as others have pointed out, use all caps anything defined as a
>> CONSTANT. That way you know it's a constant.
>
> In PHP it is not a requirement that a constant be defined in upper case.
> It is easy to tell the difference between a constant and a variable as one
> has a leading '$' while the other does not. Which of these two is the
> constant - FOO or $FOO?
FOO could be either a constant or a reference to a function. This is
where consistent capitalisation helps clarify:
<?php
function FOO()
{
print "bar";
}
$foo = FOO;
$foo();
?>
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Navigation:
[Reply to this message]
|