NYCPHP Meetup

NYPHP.org

[nycphp-talk] empty($array['foo']) versus array_key_exists('foo', $array)

Rob Marscher rmarscher at beaffinitive.com
Mon Oct 25 13:12:46 EDT 2010


On Oct 25, 2010, at 1:03 PM, Paul A Houle wrote:
> On 10/25/2010 12:22 PM, David Mintz wrote:
>> Anybody know of any reason not to save a little typing with
>> empty($array['foo'])
> I think also this will throw an error or exception if you're running with E_STRICT,  which you should.

I thought so too, but I tested it this morning and it didn't seem to throw a notice.  It must operate like isset.




More information about the talk mailing list