What does = @$variable do?

Marcus

Well-known member
I am curious what "@" is doing in this declaration:
PHP:
$variable = (string)@$this->_params['posts'][@$postId]['setting']
 

Jeremy

Well-known member
The @ symbol when used in PHP will hide any errors or warnings that occur because of that specific statement.
 

rellek

Well-known member
However, it's the easiest way to make old (or crappy) software like Joomla 1.x work without raising errors in PHP 5.3+.

Btw @Marcus, where did you get this line from?
 

twhiting9275

Well-known member
However, it's the easiest way to make old (or crappy) software like Joomla 1.x work without raising errors in PHP 5.3+.
actually, the easiest way is to use ini to set display_errors to 0 , but yeah, for most that's going to be the easiest way :)
 
Top