-
Notifications
You must be signed in to change notification settings - Fork 800
Fixed 'Undefined index' #695
base: master
Are you sure you want to change the base?
Conversation
ephemeralsnow
commented
May 12, 2016
@ephemeralsnow |
Using isset() is faster than array_key_exists(). |
If the default value was null? |
Yes, but then your comment is confusing, imho: // Empty variable? Replace with the default value. In that case if the default value is null anyway, assigning the null character terminator "\0" might be a good idea to use if you want isset() to pass the check. But, to my original comment, since isset() is a language construct it's much faster in benchmarks. Plus there's a quirk in the behavior of array_key_exits() that you'll have to watch out for:
I'm not picking on your commit, though - I just had a very similar issue at work this week so the problem space is really fresh on my mind. ;) |
Thank you for your reply. It was fixed. |
@froschdesign
Are there any other things you need? |
Yes, the test |
Tests were added after I got the first comment. |
Ah, sorry. I've overlooked that. |