-4

I've come across some PHP that triggers file_put_contents() as follows:

@file_put_contents($path_name_to_write_to, $string);

What's the significance of @ before the function call - if any? How is this different from file_put_contents($path_name_to_write_to, $string); - if at all?

Thanks.

James Spittal
  • 235
  • 5
  • 12

2 Answers2

2

From PHP manual: "PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored."

Source: http://www.php.net/manual/en/language.operators.errorcontrol.php

1

As per the doc:

PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.

documentation

halfer
  • 19,824
  • 17
  • 99
  • 186
Awlad Liton
  • 9,366
  • 2
  • 27
  • 53