-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
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
[5.2.40] Pagination broken on PHP7.0.8 (Division by 0) #14387
Comments
Same bug for me. commit: 41fd377 |
This was broken by #14188 |
Why does your If you call if you call |
It shouldn't equal 0. It equals 20. Adding Essentially the We call paginate with no arguments. |
Fix submitted #14389 |
@alexhouse Sorry for that, I've introduced it when adding optimization for pagination, now fix by @themsaid is already included in latest release |
In the process of updating our composer libraries it seems Laravel 5.2.40 pagination breaks in at least PHP7.0.8.
It appears PHP7 can't handle assigning variables whilst assigning a variable. Problematic code:
Essentially,
$page
and$perPage
end up asnull
and0
, causingLengthAwarePaginator
to backflip over a division by 0.This can be demonstrated through Tinker:
I imagine this is more of a PHP7 problem but Laravel could, in the meantime, revert to the previous implementation of
Builder::paginate()
which doesn't have this problem in order to resolve this issue.The text was updated successfully, but these errors were encountered: