I have code like this:
$qs = str_replace('foo=' . $_GET['foo'], '', $qs);
When $_GET['foo'] doesn't exist, though, I get a NOTICE. Which isn't a big deal, but it makes me question whether I'm following proper protocol, and if I should make adjustments in case a future release takes it more seriously.
The obvious solution would be to predeclare any of them in advance:
$_GET['foo'] ?= false;
$qs = str_replace('foo=' . $_GET['foo'], '', $qs);
but I hate to waste time and space if it's unnecessary. Or if there's a better way.