Bug #70500 [Opn->Wfx]: array_keys() returns NULL
| From: | requinix@php.net | Date: | Tue, 15 Sep 2015 11:51:44 +0000 |
| Subject: | Bug #70500 [Opn->Wfx]: array_keys() returns NULL | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12752@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70500&edit=1
ID: 70500
Updated by: requinix@php.net
Reported by: miloslav dot hula at gmail dot com
Summary: array_keys() returns NULL
-Status: Open
+Status: Wont fix
Type: Bug
Package: Documentation problem
PHP Version: 7.0.0RC2
Block user comment: N
Private report: N
New Comment:
Standard practice for internal functions is to return NULL when passed arguments of the wrong type.
Documenting this on every single function page would be crazy so it's mentioned on the internal
functions page instead.
http://php.net/functions.internal
Previous Comments:
------------------------------------------------------------------------
[2015-09-15 10:07:04] miloslav dot hula at gmail dot com
Generally returns NULL on anything else than array.
------------------------------------------------------------------------
[2015-09-15 10:03:38] miloslav dot hula at gmail dot com
Description:
------------
The array_keys() returns NULL when called with NULL instead of array.
Test script:
---------------
<?php
var_dump(array_keys(NULL));
Expected result:
----------------
array(0) {
}
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70500&edit=1