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

I hope you realize that "fixing" these types of early mistakes is almost impossible for PHP, a language which tries hard not to break things, especially something that's going to be used everywhere. But if this is such a deal-breaker and your IDE is dumb as a stump and can't remind you nothing prevents you from wrapping the stdlib or using something like psl to do it for you.


> I hope you realize that "fixing" these types of early mistakes is almost impossible for PHP

I do, yes; which means early mistakes stay in the language forever; same as in javascript. More's the pity.


If its powering 80% of the internet, 30% of all ecommerce websites, its not a mistake.


I think fixing as in "removing and replacing" is indeed impossible, but defining a new convention and making alternative names for the same function would work fine.

Let's say the new convention is that functions are named str_*(), then keep strpos(), but create a new one called str_pos() that is the same, and mark the old one as deprecated (but don't remove it).

I am sure there are edge cases where both str_* and str* exist already and do different things, but we can figure something out.


I think you actually could fix this forward by using named arguments instead of positional ones?




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

Search: