re: Using isset() and empty() hurts your code VIEW POST


I've been using PHP for around 15 years. I've never really liked isset() and empty(), mainly because of their names. empty() should be isempty().

Then there are functions like is_int() which use another name style. (I'd prefer they were all named like this).

I STILL have to look up those function names every time. Now I'm not going to bother :-)

And I didn't know about array_key_exists()... Thanks!


Yeah the mixed naming conventions were starting to annoy me too recently. Haven't been using the language nearly as long as you have. But I would hope they would do something like rename all of the runonname functions the other way, alias the old names to the new ones, and then include a deprecation message for the old names and move on. At least that way it would be backwards compatible for however long before they're removed entirely.

Would also prefer renaming some functions like strlen to string_length or at least str_length.

code of conduct - report abuse