Re: hex2bin: E_WARNING is too much for odd string?

From: Date: Wed, 26 Jun 2013 22:13:39 +0000
Subject: Re: hex2bin: E_WARNING is too much for odd string?
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-67909@lists.php.net to get a copy of this message
Hi 2013/6/26 Yasuo Ohgaki <yohgaki@ohgaki.net>: > PHP 5.4: Keep current behavior > PHP 5.4: Riase E_ERROR and return FALSE for invalid length. > PHP 5.5: Remove E_ERROR. Never ever will we raise an E_ERROR. E_ERROR means that we left the Engine in a state from which we cannot recover from, standard library function should never prevent execution of a script as this will introduce inconsistency, if we leave the Engine in a 'recoverable' state, then we should use E_RECOVERABLE_ERROR, but this is far from that. We already fixed a few of those in the past, I believe when 5.3 was shipped, we had pretty much killed all of those along when the new parameter parsing API was being standardized. I agree that this E_WARNING is sort of serve, and we should just return false for invalid values, as we don't need to be THAT detailed, maybe an E_NOTICE could work better here even in case something fails and the developer must know WHY this happened, I believe we do this in a few places around the core and its extensions. -- regards, Kalle Sommer Nielsen kalle@php.net

« previous php.internals (#67909) next »