Explicit Variable Declaration?

From: Date: Fri, 18 Oct 2002 00:12:02 +0000
Subject: Explicit Variable Declaration?
Groups: php.general 
Request: Send a blank email to php-general+get-120497@lists.php.net to get a copy of this message
Is there a way to force variable declaration (instead of implicit?) I constantly run into the problem where i misspell a variable name and it is assumed to be unitialized (null?)... function show_results($_sql, $_query, $_first, $_n, $_max, $_show_count) { global $HTTP_GET_VARS; ... if (!$_show_cnt) { ...always does this... } an EXPLICIT command would force variables to be defined (var $cnt) before it is used. This is similar to commands used in various BASIC implementations. Is there such a thing in PHP? -greg

« previous php.general (#120497) next »