note 105082 deleted from language.constants by danbrown
| From: | danbrown@php.net | Date: | Tue, 26 Jul 2011 19:33:23 +0000 |
| Subject: | note 105082 deleted from language.constants by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-181907@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
In response to "dexen', who said:
In response to ``kencomer'':
3) Why not to use <?php
define( 'DEBUG', FALSE );
define( 'DEBUG', TRUE ); ?>
and comment one of them out as needed when developing/deploying?
That'd save a lot of ugly ``if ( defined( 'DEBUG' ) && DEBUG )
{}''.
~~~~~~~~~~~~
Well I'll tell you why; because we'd much rather do this:
<?
include( 'debugger.php' ); // Defines constant DEBUGGING
. . . some code . . .
if ( DEBUGGING ) debug_message("Something is going on")
. . . some more code . . .
?>
However, THAT always evaluates to true, even if we don't include the debugger.
Ergo, PHP was badly misguided in considering unknown constants as strings.