Saturday, 24 September 2016

operators - PHP functions and @functions



Basically, I've seen people using @ before their function calls, not for every function, but for some kind of extension functions like file_get_contents(), mysql_connect() and so on.



And yes, the question is: For what purpose are there these @s before function calls?



Or in other words, what is the difference between @file_get_contents() and file_get_contents()?


Answer




@ is an error control operator. Basically it's suppressing errors.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...