>> 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.
This is exactly the type of situation where E_PARSE really bothers me as well.. Although no one likes eval(), and it seems to me it is become more and more of a security-risk and less and less useful... The last time I've actually seen it implemented in a useful way (that couldn't be done in a better way) was in PHPLIB. Then again, maybe I'm not coding things that would need such a function :) >> $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. What about require'd files? Back on the note that I was discussing (the E_PARSE with a user error-handler), Perhaps the issue can be slightly skirted without having to code a whole lot... Specifically, what about simply re-directing the user to another URL in the event of a fatal PHP error (as specified by a directive)... Ie. On_fatal_error=http://somewhere.com/error.php Where on a E_PARSE, or something similar, PHP basically does a C-version of: <?php header("Location: http://somewhere.com/error.php?errno=4"); ?> This way, users who don't care can still re-direct a browser to a nice and pretty "sorry, the server is really screwed" HTML page... Or, if they'd like, they can simply take that error number and create a error-handler in PHP without us having to bother with the problems surrounding a bad parser-state... John >Derick > >-- > >--------------------------------------------------------------- >------------ > Derick Rethans >http://derickrethans.nl/ > JDI Media Solutions >--------------[ >if you hold a unix shell to your ear, do you hear the c? ]- > > > -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php