I'm new to PHP and I'm confused seeing some examples calling a function with a @ prefix like @mysql_ping().
What is it for? Googling / searching is not much of a help since @ gets discarded and 'alias' is not good enough keyword.
@ suppresses errors, warnings and notices.
You can use it for good purpose if you complement it with a custom error handler or with due check of $php_errormsg variable so you can handle errors properly.
In my experience, this proper usage is not seen very much and is instead used a lot in the bad way, just to hide errors without acting on them.
More info at http://www.php.net/manual/en/language.operators.errorcontrol.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With