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

2.5.0 fails with PHP 5.5.9 #1213

Closed
jhull opened this Issue Jan 31, 2017 · 1 comment

Comments

Projects
None yet
4 participants
@jhull

jhull commented Jan 31, 2017

Expected behaviour

2.5.0 update works great on PHP 7.0.8 at home

Actual behaviour

On server boasting PHP 5.5.9 it fails with this error:

ErrorException in CollectionsServiceProvider.php line 83:
Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH'

which apparently is only available on 5.6.0

Docs say minimum is 5.5.9

Steps to reproduce

Server configuration

Operating system:

Web server:

PHP version:

Statamic version:

Updated from an older Statamic or fresh install:

List of installed addons:

Logs

If any logs (browser, server, or Statamic) are appropriate...

Add those logs here

@jackmcdade jackmcdade assigned jasonvarga and jaggy and unassigned jasonvarga Jan 31, 2017

@jaggy

This comment has been minimized.

jaggy commented Jan 31, 2017

Thanks! It'll be fixed in the next release! 👍

For a quick fix though, you can replace CollectionServiceProvider's line 82 - 84 with:

$items = [];

foreach ($this->items as $key => $value) {
    if (! $callback($value, $key)) {
        continue;
    }

    $items[$key] = $value;
}

return new static($items);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment