Hacker News new | past | comments | ask | show | jobs | submit login

I think the problem is that doesn't work for cases where you have a minimal constructor and do the rest in a static method which wraps it, or where you construct the class while skipping the constructor (and probably some other cases). PHP allows more flexibility here than other languages, and these sorts of cases are not uncommon. Mocking libraries and databases interfaces do the latter, and using the former to simulate multiple constructors is a common pattern.



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

Search: