[vox-tech] php question - strict variable declarations?

Peter Jay Salzman vox-tech@lists.lugod.org
Thu, 6 Jun 2002 10:18:43 -0700


hi richard!

begin Richard S. Crawford <rscrawford@mossroot.com> 
> Pete,
> 
> The closest thing I can think of is checking to see if the variable is set...
> 
> if (!isset($myUnsetVariable)) print "This variable isn't set, you bastard!";
 
heh.  i guess the answer is "no"...   ;-) 

> I haven't played with PHP since before 4.2, so I'm not sure if new
> levels of functionality have been added or not, but to my knowledge
> there is no method in PHP of pre-declaring variables or a PHP
> equivalent of "use strict".
> 
> There oughtta be, though.

yeah.  php is way too forgiving.  i noticed that unless there's a really
bad error, php will just do what it thinks is the best course of action.
i'd rather just know that an array element is uninitialized rather than
having the browser output blank...

thanks richard!

pete