Avatar of joyacv2
joyacv2
Flag for Puerto Rico asked on

@$ in PHP

hi

what is a @ symbol before a $ in a variable declaration

example:   @$variableTest
PHP

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
Gary

Suppress any error
http://php.net/manual/en/language.operators.errorcontrol.php

In that case if the var doesn't exist then the code won't burp
ASKER CERTIFIED SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dave Baldwin

I agree with Ray.  I don't think I have Any code that uses a '@' to suppress error reporting... because it does not suppress the error, it just fails to 'report' it.
Ray Paseur

Very well put, Dave.  It's like you still ran over the cat, you just didn't tell anyone.  No problem till someone says, "Here kitty" or notices that the mice are eating all of the cheese.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Mark Brady

@Ray ..
No problem till someone says, "Here kitty" or notices that the mice are eating all of the cheese.

Hahahaha nice!
Ray Paseur

Thanks for the points and thanks for using EE.  Going forward, don't feel uncomfortable about sharing the points among the answers that contribute to your understanding.  Both Gary and Dave added good information here, too!

Best wishes for new year 2014, ~Ray