We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/JamesHeinrich/getID3/blob/master/getid3/getid3.lib.php#L707
Both getid3_lib::array_min and getid3_lib::array_max seem to find array max.
getid3_lib::array_min
getid3_lib::array_max
This might be a copy/paste mistake. I assume array_max was copied, variables were renamed, but the condition was not changed.
array_max
/** * @param array $arraydata * @param bool $returnkey * * @return int|false */ public static function array_max($arraydata, $returnkey=false) { $maxvalue = false; $maxkey = false; foreach ($arraydata as $key => $value) { if (!is_array($value)) { if ($value > $maxvalue) { $maxvalue = $value; $maxkey = $key; } } } return ($returnkey ? $maxkey : $maxvalue); } /** * @param array $arraydata * @param bool $returnkey * * @return int|false */ public static function array_min($arraydata, $returnkey=false) { $minvalue = false; $minkey = false; foreach ($arraydata as $key => $value) { if (!is_array($value)) { if ($value > $minvalue) { $minvalue = $value; $minkey = $key; } } } return ($returnkey ? $minkey : $minvalue); }
Note that it's not enough to change > to <. The initial value of minvalue needs to be changed too, otherwise array_min could return false.
>
<
minvalue
array_min
false
The text was updated successfully, but these errors were encountered:
bugfix: #247 array_min incorrect return value
13dc22a
#247
Thanks, fixed in 13dc22a
Sorry, something went wrong.
No branches or pull requests
https://github.com/JamesHeinrich/getID3/blob/master/getid3/getid3.lib.php#L707
Both
getid3_lib::array_min
andgetid3_lib::array_max
seem to find array max.This might be a copy/paste mistake. I assume
array_max
was copied, variables were renamed, but the condition was not changed.Note that it's not enough to change
>
to<
. The initial value ofminvalue
needs to be changed too, otherwisearray_min
could returnfalse
.The text was updated successfully, but these errors were encountered: