min
Returns the lowest value among the given values, or the lowest value in an array.
Parameters
main.php
Return Values
mixed
Returns the lowest value among the input values
On success:The minimum value found among all compared values
On failure:TypeError if array is empty or contains uncomparable values
Notes
- Compares values using PHP's standard comparison rules
- String comparison is lexicographic (alphabetical)
- Can accept multiple parameters or a single array
- Returns the original type of the minimum value found
Changelog
- 4.0.0: Function was introduced
- 8.0.0: Throws TypeError for empty arrays
Related Functions
usort
ArraySorts an array by values using a user-defined comparison function, losing original keys.
sortcustomcompare
array_diff
ArrayCompares two or more arrays and returns the values from the first array that are not present in any of the other arrays.
comparedifferencefilter
max
MathReturns the highest value among the given values, or the highest value in an array.
maximumcomparehighest