2012/9/3 Lester Caine <les...@lsces.co.uk>: > more ... try/catch always seems like 'I can't be bothered so just do this if > you can' where it would be much tidier if file_put_contents(); was written > so it simply finished with an error if it has a problem?
Hm. I want to bring in some thoughts. Perhaps I have not the right words to describe what I mean, but there are 3 things which come in my mind when PHP may switch the error-handling to any kind of exceptions: 1. Current error-handling has it's advantages. Ideal for short programs. I don't wanna miss it. I need to ignore errors completely. 2. I think - prove me wrong :) - it is not possible to change the hole error-handling from one PHP-version to another, especially when the behavior changes so entirely. I think it will take some time. Maybe we have to live with a mixture (new exceptions and old error-handling) for some time? 3. Why not having this as concept? Maybe it's a good strategy to enable both: current error-handling and having exceptions? The rest is logic: When I want to enable to handle an exception like an PHP-error, I need to tell PHP during the creation of the error, that it should not handle it like an exception. Ok, ok, as Rasmus correctly mentioned, uncaught exceptions are by definition fatal. But isn't catching an exception not like "I know how to handle it?" And when I know how to handle it, couldn't I handle it in the exception directly? More questions than answers so far. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php