Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@ character before a function call

Tags:

php

the "@" will silence any php errors your function could raise.


It silences errors and warnings. See Error Control Operators.


As already answered the @ will stop the error (if any) from showing up.
In terms of performance this is not recommended.

What php is doing is:

  • reading the error display state
  • setting the error display to show no errors
  • running your function
  • setting the error display to it's previous state

If you don't want any errors showing up use error_reporting(0);.

Or just write bug free code :P


http://www.faqts.com/knowledge_base/view.phtml/aid/18068/fid/38

All PHP expressions can be called with the "@" prefix, which turns off error reporting for that particular expression.