In my code (with php notice errorhandling) I have lots of these blocks inside loops:
$someVar=array();
...
foreach (...){
if(!isset($someVar["something"])){
$someVar["something"]=0;
}
$someVar["something"]++;
}
another solution would be to ignore the notice with @
@$someVar["something"]++
which is not very clean.
is there a cleaner way to initialize a variable with 0 only if not set?