Home >Backend Development >PHP Tutorial >The difference between array_key_exists and isset in php

The difference between array_key_exists and isset in php

WBOY
WBOYOriginal
2016-07-25 08:59:141031browse
This article introduces the difference between array_key_exists and isset in the PHP language. Friends in need can refer to it.

What are the differences between array_key_exists and isset in php?

1. The judgment of array values ​​is different. If the value is null or '' or false, isset returns false and array_key_exists returns true; 2. The execution efficiency is different. isset is a built-in operator, array_key_exists is a PHP built-in function, and isset is faster. 3. When using isset to access a non-existent index array value, an E_NOTICE php error message will not be caused; 4. array_key_exists will call get_defined_vars to determine whether the array variable exists, and isset is not used;



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn