mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX SplFixedArray causes segfaults in old versions of PHP
This commit is contained in:
parent
e0e481fc46
commit
3543a93623
@ -598,7 +598,13 @@ class Config_LRU {
|
||||
protected $c = 0;
|
||||
|
||||
public function __construct() {
|
||||
$this->cache = new SplFixedArray(self::SIZE);
|
||||
if (version_compare(PHP_VERSION, '5.3.7', '<')) {
|
||||
// SplFixedArray causes seg faults before PHP 5.3.7
|
||||
$this->cache = array();
|
||||
}
|
||||
else {
|
||||
$this->cache = new SplFixedArray(self::SIZE);
|
||||
}
|
||||
|
||||
// Pre-fill with stdClass instances. By reusing we avoid object-thrashing
|
||||
for ($i = 0; $i < self::SIZE; $i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user