Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8123
| From | "Peter H. Coffin" <hellsop@ninehells.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: define ('NL', "<br />"); can I define a constant var ? |
| Date | 2013-01-22 19:03 -0600 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrnkfudmq.m9f.hellsop@nibelheim.ninehells.com> (permalink) |
| References | <bfe0fbed-6727-437f-9c62-552c03dd4692@b11g2000yqh.googlegroups.com> <50FE502B.2070708@arnowelzel.de> <sr5uf89fourrm1gdmqr442ttf1pk9hnqbu@4ax.com> <kdn665$tn7$1@dont-email.me> <5o8uf85qi8jltuv68s8j22ds05mvs93esu@4ax.com> |
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
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
define ('NL', "<br />"); can I define a constant var ? cate <catebekensail@yahoo.com> - 2013-01-21 16:06 -0800
Re: define ('NL', "<br />"); can I define a constant var ? Adam Harvey <usenet@adamharvey.name> - 2013-01-22 00:44 +0000
Re: define ('NL', "<br />"); can I define a constant var ? BobMCT <r.mariotti@fdcx.net> - 2013-01-21 21:16 -0500
Re: define ('NL', "<br />"); can I define a constant var ? Kim André Akerø <kimandre@nospambetadome.com> - 2013-01-22 03:50 +0100
Re: define ('NL', "<br />"); can I define a constant var ? denisb <newdb@no-log.org> - 2013-01-22 08:17 +0100
Re: define ('NL', "<br />"); can I define a constant var ? Arno Welzel <usenet@arnowelzel.de> - 2013-01-22 09:39 +0100
Re: define ('NL', "<br />"); can I define a constant var ? Luuk <luuk@invalid.lan> - 2013-01-22 19:43 +0100
Re: define ('NL', "<br />"); can I define a constant var ? Tim Streater <timstreater@greenbee.net> - 2013-01-22 18:58 +0000
Re: define ('NL', "<br />"); can I define a constant var ? Luuk <luuk@invalid.lan> - 2013-01-22 20:08 +0100
Re: define ('NL', "<br />"); can I define a constant var ? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-01-23 01:35 +0100
Re: define ('NL', "<br />"); can I define a constant var ? Arno Welzel <usenet@arnowelzel.de> - 2013-01-23 10:59 +0100
Re: define ('NL', "<br />"); can I define a constant var ? The Natural Philosopher <tnp@invalid.invalid> - 2013-01-22 19:40 +0000
Re: define ('NL', "<br />"); can I define a constant var ? Arno Welzel <usenet@arnowelzel.de> - 2013-01-23 10:55 +0100
Re: define ('NL', "<br />"); can I define a constant var ? Jørn Andersen <jorn@jorna.dk> - 2013-01-22 23:51 +0100
Re: define ('NL', "<br />"); can I define a constant var ? Shake <alex.estevezQUENO@QUENOfilnet.es> - 2013-01-23 00:08 +0100
Re: define ('NL', "<br />"); can I define a constant var ? Jørn Andersen <jorn@jorna.dk> - 2013-01-23 00:51 +0100
Re: define ('NL', "<br />"); can I define a constant var ? "Peter H. Coffin" <hellsop@ninehells.com> - 2013-01-22 19:03 -0600
Re: define ('NL', "<br />"); can I define a constant var ? Shake <alex.estevezQUENO@QUENOfilnet.es> - 2013-01-23 03:42 +0100
Re: define ('NL', "<br />"); can I define a constant var ? Jerry Stuckle <jstucklex@attglobal.net> - 2013-01-22 19:50 -0500
csiph-web