Many thanks everyone.
Seems like I should be using constants a lot of places where I've been
using globals.
Al wrote:
Can someone explain to me the value of using defined custom constants,
in the context of good coding practice.
I don't recall ever seeing define() used in the scripts I've see
* Thus wrote Greg Donald ([EMAIL PROTECTED]):
> On Fri, 2004-05-21 at 08:37, Richard Davey wrote:
> > Absolutely - and one of the best features of constants is their scope
> > - being global in nature you can use them ANYWHERE which is very handy
> > indeed!
>
> ANYWHERE except in code you plan to
yes, constants have global scope also :-)
"Craig" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Have a look here also: http://ie2.php.net/define
>
>
> "Al" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Can someone explain to me the value of using defined custom
On Fri, 2004-05-21 at 08:37, Richard Davey wrote:
> Absolutely - and one of the best features of constants is their scope
> - being global in nature you can use them ANYWHERE which is very handy
> indeed!
ANYWHERE except in code you plan to eval().
Funny how get_defined_constants() knows about al
Hello Craig,
Friday, May 21, 2004, 2:30:20 PM, you wrote:
C> Constants are useful when a variable will remain exactly the same
C> (constant) through the life of a script.
Absolutely - and one of the best features of constants is their scope
- being global in nature you can use them ANYWHERE whic
Have a look here also: http://ie2.php.net/define
"Al" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can someone explain to me the value of using defined custom constants,
> in the context of good coding practice.
>
> I don't recall ever seeing define() used in the scripts I've see
Constants are useful when a variable will remain exactly the same (constant)
through
the life of a script. e.g a script I wrote to calculate dates be it in the
past or future
would have constant values for how many seconds are in a day or a week. to
be used
in calculations.
e.g:
define("SECONDSIN
7 matches
Mail list logo