Hello,

I've followed the war, sorry, discussion about exceptions.
Now, let me introduce some problems I've found in Tidy.

Look at the code:
<?

//doesn't echo any error, but should!
//should generate a E_WARNING because it can't find the file
$tidy = tidy_parse_string('sdgdsg', 'BogusConfig.file');

/*********************************************************/


//throw exception instead of E_WARNING
try {
$tidy = tidy_parse_string('sdgdsg', array('bogusconf' => 'bogusvalue'));

//because of throwing the exception, this function is never executed
//thus making it complitely unusefull.
echo tidy_config_count($tidy);
}
catch (tidy_exception $e) {
echo $e;
}

/*********************************************************/


//an exception here. why? a BUG?!?!?!
$tidy = new tidy();
$tidy->ParseString('test');

?>


These are just some examples. I don't hate exceptions, but whe they are
misused...
John said that Tidy should only generate exceptions with OO code, but as you
can see in the above code, it generate exceptions with non-OO code.


Nuno

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to