You are here: Re: array() VS Array() « PHP Programming Language « IT news, forums, messages
Re: array() VS Array()

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация