#50687 [Bgs]: array_reverse return values missing NULL
ID: 50687
User updated by: hanskrentel at yahoo dot de
Reported By: hanskrentel at yahoo dot de
Status: Bogus
Bug Type: Documentation problem
Operating System: win
-PHP Version: 5.2.12
+PHP Version: 5.2.8
New Comment:
Sorry for not mentioning that it does a warning as well:
So it does return NULL and it does a warning.
According to the documentation it does return array only, not NULL.
Previous Comments:
------------------------------------------------------------------------
[2010-01-07 23:02:05] kalle@php.net
According to the sources, then the only time array_reverse() would
return NULL would also emit an E_WARNING in the 5.2 branch:
2696 if (Z_TYPE_PP(input) != IS_ARRAY) {
2697 php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should
be an array");
2698 return;
2699 }
------------------------------------------------------------------------
[2010-01-07 17:39:19] hanskrentel at yahoo dot de
Description:
------------
array_reverse has array as documented return type. while running
var_dump(array_reverse(NULL)); it reported to me NULL. I
think some documentation is missing here.
Reproduce code:
---------------
---
From manual page: function.array-reverse#Return Values
---
Expected result:
----------------
array (Not that I personally would expect that, but the documentation).
Actual result:
--------------
null
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50687&edit=1
Thread (5 messages)