Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

2.5.0 fails with PHP 5.5.9 #1213

Closed
jrhull opened this issue Jan 31, 2017 · 1 comment
Closed

2.5.0 fails with PHP 5.5.9 #1213

jrhull opened this issue Jan 31, 2017 · 1 comment
Assignees

Comments

@jrhull
Copy link

jrhull 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
Copy link

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants