FIX: Don’t use SplFixedArray in PHP 7.

PHP 7 seems to suffer a segfault when using SplFixedArray. Since LRU is
deprecated anyway, I’m not too fussed about getting to the bottom of
this issue, however, if it turns out that SplFixedArray is corrected in
PHP 7.0.0 stable or a future patch release, we could update this check.
This commit is contained in:
Sam Minnee 2015-08-28 16:42:43 +12:00
parent aeccb8b8e0
commit f5af0c85ba

View File

@ -703,8 +703,8 @@ class Config_LRU {
public function __construct() {
Deprecation::notice('4.0', 'Please use Config_MemCache instead', Deprecation::SCOPE_CLASS);
if (version_compare(PHP_VERSION, '5.3.7', '<')) {
// SplFixedArray causes seg faults before PHP 5.3.7
if (version_compare(PHP_VERSION, '5.3.7', '<') || version_compare(PHP_VERSION, '6.99.99', '>')) {
// SplFixedArray causes seg faults before PHP 5.3.7, and also in 7.0.0-RC1
$this->cache = array();
}
else {