Well, of course, it’s better to check what is installed $x
... but there is debate that is worse in performance, isset()
or is producing notice
.
I would use isset($x)
and check, but:
...
if (@ctype_alnum($x)) echo true;
...
using @
to suppress errors might be better.
EDIT: according to this link
The difference was that suppressing the notification (notification!) Took 100% if you just checked to see if it existed in the first place.
so ... isset($x)
that.
source
share