Doc #70596 [Asn->Csd]: No description of warning for min(array())
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
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.6.13
Assigned To: tpunt
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-12-18 20:39:12] tpunt@php.net
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
------------------------------------------------------------------------
[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
Thread (3 messages)