Re: Deprecation of the Error Control Operator (@ symbol)

From: Date: Fri, 08 Jan 2016 18:45:34 +0000
Subject: Re: Deprecation of the Error Control Operator (@ symbol)
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-90389@lists.php.net to get a copy of this message
Hi! > when doing something defined as invalid will be hard. If you don't want > to count garbage, then you should use if() > > if (!is_garbage($key)) @$count[$key]++; And if you want to check, just do: if (is_garbage($key)) { throw Exception("Garbage!"); } Except in this case you know what's going on and when the exception is thrown and can do what you like, instead of your code just blowing up randomly with no warning. Or, alternatively, having to check for an exception each time you do an array access. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#90389) next »