On Wednesday, July 6, 2011, Dave Wilson wrote:
> OK. We all know that constants cannot be accessed directly via their
> name in double-quoted or heredoc strings.
FWIW, this looked like it might be a right royal PITA for me ATM.
However, I've got a work-around.
With about a dozen scripts written
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
You can keep constant variables in an interface, because thay are
static and do not change. Trust me, it is a bug.
"Gerben" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> this is probably because Foo is an interface instead of a class.
interfaces
> can't contain any data as far as I
this is probably because Foo is an interface instead of a class. interfaces
can't contain any data as far as I know.
"Jakes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The bug server looks like its down, so I will just post the bug here, and
> hopefully someone
> will spot it
>
10 matches
Mail list logo