I turned on errors in php:
ini_set('displa y_errors','1');
And I got a slew of notices and a couple of warnings.
The notices are mostly missing indexes from doing things like this:
$some_var = $_REQUEST['some_name'];
And the warnings are when I have something like this:
Missing argument 1 ...
function someFoo($var1){
if($var1){...}
}
someFoo();
So, I turned display_errors back off, but wonder if I should do
anything about the this.
What is good programming practice?
Generally I care more about whether a variable is null or empty, and
not whether it has been set, which is what the "notices" seem to be
about. If I were to do this:
if(isset($var1) ){
// I'd still have to do this:
if($var1){...
PHP is a new language for me, and I'd like to write "correctly"...b ut
I don't want to bloat the code either.
Oh, one more thing, I slipped into perl mode and did this:
$SOME_ARRAY{som e_key} and got no complaints, Is that "kosher"?
Jeff
Comment