Craig Francis wrote on 26/08/2015 12:23:
If you want some example of where I got this wrong... I have a config array [...] When creating a URL builder that allowed the query string to be passed in as an array [...] Neither were major problems, just a slight annoyance (i.e. identified and fixed before I committed the code). But I'm normally using an isset() as the proposed exists() function would work.
Both of these example involve not an undefined variable, but an undefined array key, which is a much less controversial scenario.
Fortunately, the function you are looking for already exists: http://php.net/array_key_exists
Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php