What is the difference between @$_REQUEST[]
and $_REQUEST[]
? Why do we use @
in front of $_REQUEST[]
?
Asked
Active
Viewed 319 times
-1

J. Steen
- 15,470
- 15
- 56
- 63

user3021515
- 261
- 3
- 7
2 Answers
0
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.
Please refer http://php.net/manual/en/language.operators.errorcontrol.php

Ashwini Agarwal
- 4,828
- 2
- 42
- 59
-
$id=@$_REQUEST['id']; is it ignore error like undefined variable id if $_REQUEST['id'] returns null ?? – user3021515 Dec 18 '14 at 06:11
-
thanks .. in my log report so many these kind of errors are coming (undefined variable) so i can use $id=@$_REQUEST['id']; right OR $id= isset($_REQUEST['id']) ? $_REQUEST['id'] : ''; which is better ??? – user3021515 Dec 18 '14 at 07:02
-
Please use second one.. – Ashwini Agarwal Dec 18 '14 at 10:52
0
@$_REQUEST[] - using @(error control operator) to hide errors
$_REQUEST[] - HTTP Request variables

Rakesh Sharma
- 13,680
- 5
- 37
- 44