Doc #70596 [Asn]: No description of warning for min(array())
| From: | tpunt@php.net | Date: | Fri, 18 Dec 2015 20:39:12 +0000 |
| Subject: | Doc #70596 [Asn]: No description of warning for min(array()) | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12976@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70596&edit=1
ID: 70596
Updated by: tpunt@php.net
Reported by: lennaertvanderlinden at gmail dot com
Summary: No description of warning for min(array())
Status: Assigned
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.6.13
Assigned To: tpunt
Block user comment: N
Private report: N
New Comment:
All PHP functions will emit an E_WARNING and return false when a function's required arguments
have not been passed in.
As for passing in empty arrays, I've made the following commit to mention this in both the
min() and max() functions: https://svn.php.net/viewvc?view=revision&revision=338308
Previous Comments:
------------------------------------------------------------------------
[2015-12-18 20:36:13] tpunt@php.net
Automatic comment from SVN on behalf of tpunt
Revision: http://svn.php.net/viewvc/?view=revision&revision=338308
Log: Resolve doc bug #70596
------------------------------------------------------------------------
[2015-09-28 08:56:17] lennaertvanderlinden at gmail dot com
Description:
------------
I am using PHP 5.6.4-4ubuntu6.2
The documentation does not describe the behaviour when an empty array is passed in or no arguments
at all.
I get a warning in PHP 5.6, but this may be version specific. I would like to see the behaviour
described for the min and max functions:
- warnings emitted
- return value
Test script:
---------------
<?php
print min(array()); // returns false, emits a warning in PHP 5.6
print min(); // returns NULL, emits a warning in PHP 5.6
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70596&edit=1