note 90993 deleted from function.defined by danbrown

From: Date: Wed, 20 May 2009 02:38:50 +0000
Subject: note 90993 deleted from function.defined by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155768@lists.php.net to get a copy of this message
Note Submitter: steven at acko dot net ---- You'd expect to be able to pass anything into defined(), and that it would just return TRUE or FALSE depending on whether the input is a valid constant. You'd be wrong. Invoking defined('::') will throw a fatal, unrecoverable error. This will happen for any string which contains '::' prefixed by an invalid class name. GO PHP! You've created a function designed to make a validating statement about its input, but which cannot be invoked safely without validating its input beforehand.

« previous php.notes (#155768) next »