note 36752 rejected from function.defined by didou

From: Date: Tue, 21 Oct 2003 13:25:13 +0000
Subject: note 36752 rejected from function.defined by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59035@lists.php.net to get a copy of this message
Note Submitter: void@openssl.it ---- Using PHP 4.3.4RC1. It should *really* be noted that if you expect that this function: <?php function safeDefine($const, $val) { if(!defined($const)) { define($const, $val); } } ?> will do what you might expect, you are wrong. I don't know if this is a bug or not, but the function that works for this example is: <?php function safeDefine($const, $val) { if(defined($const) === FALSE) { define($const, $val); } } ?>

« previous php.notes (#59035) next »