What is the difference between @$_REQUEST[]
and $_REQUEST[]
? Why do we use @
in front of $_REQUEST[]
?
Asked
Active
Viewed 71 times
-1
![](../../users/profiles/64976.webp)
J. Steen
- 14,900
- 15
- 57
- 62
![](../../users/profiles/3021515.webp)
user3021515
- 251
- 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
![](../../users/profiles/1288198.webp)
Ashwini Agarwal
- 4,755
- 2
- 38
- 58
-
$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
![](../../users/profiles/878888.webp)
Rakesh Sharma
- 13,404
- 4
- 34
- 41