Re: error handling

From: Date: Mon, 18 Nov 2002 10:39:50 +0000
Subject: Re: error handling
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-91243@lists.php.net to get a copy of this message
On Mon, 18 Nov 2002, Kjartan Mannes wrote: > Monday, November 18, 2002, 11:23:08 AM, Derick Rethans wrote: > > That can be done, but I don't like this. You should not have any > > parse errors in your code anyway, so it just should fail as hard as > > possible. > > Can't argue with that, however (;)), I find it annoying that PHP stops > processing if there is a parse error passed to an eval() command. I'd > like a way to make eval() just return E_PARSE if the script passed to it > fails. hmm, that might be useful, and would not really be a problem to implemtn I think, but I'd like to know what the Zend Wizards think of this :) > Or a more general command to verify PHP code > php_valid($code_str). That way the people who expect parse errors in > their include files can do > > $code_str(implode("", file("include.inc"))); > if (php_valid($code_str)) { > include_once("include.inc"); > } That would be hard, as the zend_compile function which runs the parse also adds the functions, so if the code parses it includes it right away. Again, for this one we _could_ not abort the script, but in the case of include files I'd like to see it die hard again. eval() is something different in a logical way, but the implementation in the zend engine is about the same. Derick -- --------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --------------[ if you hold a unix shell to your ear, do you hear the c? ]-

« previous php.dev (#91243) next »