note 124740 deleted from function.array-key-exists by crell
| From: | crell@php.net | Date: | Wed, 29 Jun 2022 20:47:15 +0000 |
| Subject: | note 124740 deleted from function.array-key-exists by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218780@lists.php.net to get a copy of this message | ||
Note Submitter: Md. Abutaleb
----
Extending from here : https://www.php.net/manual/en/function.array-key-exists.php#90687
<?php
# Working for null check
# Warning for boolean check
# Warning for float check
$a = array(null => 1, false => 2, true => 3, 4.6 => 4, "08" => 5,
"8" => 6);
var_dump(array_key_exists(null, $a)); // true
var_dump(array_key_exists(false, $a)); // warning and false
var_dump(array_key_exists(true, $a)); // warning and false
var_dump(array_key_exists(4.6, $a)); // warning and false
(array_key_exists("08", $a)); // true
var_dump(array_key_exists(8, $a)); // true
?>