Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

This should have been implemented back in PHP 5.0, when exceptions were first introduced. A try-catch block without finally is only half complete!

But it's great to see half-complete features becoming fully complete, even if a few years late.



The main argument against it (that keeps coming up on ML) is destructors and resources cleaning up after themselves. Pretty weak argument though.


Yes, considering OOP and exceptions are not dependent on each other.


You should talk to Bjarne about leaving it out of C++ :)


C++ has a finally equivalent in a different form: Every object gets to clean up at the end of the scope as part of it's destructor. If you're not using RAII to manage cleaning up resources at the end of a scope, it's probably a good idea to change your style a bit.


PHP perfectly can do the same. But I guess people want both.


It is definitely great. Although missed this for quite some years now, it is quite pleasing to see how the language continue to evolve throughout the years :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: