Re: Coding Standards : misuse of the @ error control operator

From: Date: Thu, 24 Apr 2003 11:17:41 +0000
Subject: Re: Coding Standards : misuse of the @ error control operator
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15454@lists.php.net to get a copy of this message
which version of php are you using - if you are getting errors from thing 'supposed' to be hiden by an @ sign - it's likely to be a bug in PHP.. Regards Alan Frederic Poeydomenge wrote:
Hi all, I didn't see any reference in the PEAR Coding Standards to the use of the @ error control operator, and I would like to have your opinions... This operator is certainly a powerful language construction, but IMHO I think it can be misused, and should not be used to hide some bad design. For example, in BBCodeParser.php (sorry Stijn I had the pb on this script !) there is an instructions : $nextOpenPos = @strpos($str, $this->_options['open'], $openPos + 1); that produce an alert (with error_reporting = E_ALL in my php.ini) because $openPos is initialized with the length of the string, and $openPos + 1 is outside the string : Alerte [2] offset not contained in string in /usr/share/pear/HTML/BBCodeParser.php line 289 But it should be more correct to check the argument before using it, don't you think ? Regards, -------------------- Frederic Poeydomenge
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.pear.dev (#15454) next »