Re: Declare Function

From: Date: Tue, 15 Apr 2003 04:48:55 +0000
Subject: Re: Declare Function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143865@lists.php.net to get a copy of this message
On Mon, 14 Apr 2003 lists@linuxgroup.net wrote: > When should and shouldn't you use declare? > > > Whats the difference between > > > $var = "blah"; > > and > > declare('var', 'blah'); Very simple, this is being seen as too complicated (in one of the other posts) so here's an example: $foo = 'bar'; defined ('FOO', 'bar'); if ($foo == 'bar') { print "Yep"; } if (FOO == 'bar') { print "Yep"; } See, it's not complicated, both can be used the same but constants must be scalar AND are "super global", so, available in all functions. Regards, Philip

« previous php.general (#143865) next »