Why many programmers use:
if ($_GET['var'] or $this->error)
instead of
if (isset($_GET['var']) or isset($this->error)
without adding
error_reporting( error_reporting() & ~E_NOTICE )
or, (shorter but slower)
if (@$_GET['var'] or @$this->error)
…or something similar ?
Do you need to somehow (?) configure php in the ini file to suppress the errors on non-existing variables and properties to use the “feature” or is it simply a bad practice one should avoid?
This doesn’t seem to me like bast practice at all. As you said correctly, without setting the error_reporting, PHP would throw many warnings on specific cases (where the variables weren’t set).
Using isset seems to me like the best way.