Add Comment
|
Related Links
|
TrackBack
Pitfall of Defining ConstantsThe PHP define statement is really handy. I've used it to define all kind of constants. But recently I stumbled across a pitfall when I defined a constant name two different ways different if clauses. In the true clause, I defined it one way, while defining it another way in the false clause. The constant never changes. Two things I learned from this exercise.
Knowing these constraints, I started developing my software more carefully, using scoped class variables, rather than using constants all the time. You might end up stepping on yourself quite often if you keep defining global constants. Chieh Cheng
Add Comment
|
Related Links
|
TrackBack
Did your message disappear? Read the Forums FAQ. Add CommentSpam Control | * indicates required field TrackBackTrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites. Send Ping | TrackBack URL | Spam Control No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here. Messages, files, and images copyright by respective owners. |
Products
|
Services
133 Users Online
|
Copyright © 1996 - 2024. All Rights Reserved. |