FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » define ('NL', "<br />"); can I define a constant var ?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: define ('NL', "<br />"); can I define a constant var ? [message #180189 is a reply to message #180186] Wed, 23 January 2013 01:03 Go to previous messageGo to previous message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma:
Senior Member
On Wed, 23 Jan 2013 00:51:20 +0100, J?rn Andersen wrote:
> I do understand the basics about scope, so that makes sense - and I
> would probably have used constants a bit more if I had been aware that
> constants work across scopes ...
>
> Is there any reason why it is better/worse to use constants instead of
> global $var in functions?

Well, the other thing is that constants are ... well, constant. They
don't change, nothing in the code running can affect them. They won't
get screwed up by logical or programming errors, like mistaking = for
==.

--
I think it's a beautiful day to go to the zoo and feed the ducks.
To the lions.
-- Brian Kantor
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Passing complex data back when using cURL
Next Topic: my blog
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 11:01:47 GMT 2024

Total time taken to generate the page: 0.03280 seconds