Open
Description
https://github.com/php/doc-en/blob/master/reference/math/functions/min.xml#L83
From PHP 8.0, calling min() with an empty array as argument will throw a ValueError.
Current doc does not mention this.
Fatal error: Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in [...]
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
cmb69 commentedon Nov 16, 2022
Indeed.
max()
has the same problem; and we should probably clarify, that "calling min() with an empty array as argument" refers to the second signature (see https://3v4l.org/Ic2BQ).[-]min([]) throws ValueError in php8.0[/-][+]min([]) and max([]) throws ValueError as of 8.0[/+]