Skip to content

Conversation

DianaDenpa
Copy link
Contributor

The collection "median()" method counts null as a value to divide by, resulting in an inaccurate calculation.

Examples:

  • Before
$c = new Collection([1, 2, 3, 4, 5, null])
$c->median(); // 2,5
  • After
$c = new Collection([1, 2, 3, 4, 5, null])
$c->median(); // 3

This PR is a follow up to #23909

@taylorotwell taylorotwell merged commit 274dd48 into laravel:master May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants