Skip to content

Commit

Permalink
Support PHP 5.3
Browse files Browse the repository at this point in the history
Short array syntax wasn't introduced until 5.4.
I'm all for advancement, but I'm opposed to breaking backward
compatibility for syntactic sugar :)

Fixes #38
  • Loading branch information
matthiasmullie committed Dec 17, 2018
1 parent 9d91d2e commit 87ff6c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Adapters/Apc.php
Expand Up @@ -603,7 +603,7 @@ protected function apcu_fetch($key, &$success = null)
if (is_array($key)) {
$nums = array_filter($key, 'is_numeric');
if ($nums) {
$values = [];
$values = array();
foreach ($nums as $k) {
$values[$k] = $this->apcu_fetch((string) $k, $success);
}
Expand Down Expand Up @@ -642,7 +642,7 @@ protected function apcu_store($key, $var, $ttl = 0)
if (is_array($key)) {
$nums = array_filter(array_keys($key), 'is_numeric');
if ($nums) {
$success = [];
$success = array();
$nums = array_intersect_key($key, array_fill_keys($nums, null));
foreach ($nums as $k => $v) {
$success[$k] = $this->apcu_store((string) $k, $v, $ttl);
Expand Down
2 changes: 1 addition & 1 deletion src/Adapters/Couchbase.php
Expand Up @@ -126,7 +126,7 @@ public function setMulti(array $items, $expire = 0)
// have to do those piecemeal
$integers = array_filter(array_keys($items), 'is_int');
if ($integers) {
$success = [];
$success = array();
$integers = array_intersect_key($items, array_fill_keys($integers, null));
foreach ($integers as $k => $v) {
$success[$k] = $this->set((string) $k, $v, $expire);
Expand Down
2 changes: 1 addition & 1 deletion src/Adapters/Memcached.php
Expand Up @@ -419,7 +419,7 @@ protected function decode($key)
*/
protected function setMultiNumericItemsForHHVM(array $items, array $nums, $expire = 0)
{
$success = [];
$success = array();
$nums = array_intersect_key($items, array_fill_keys($nums, null));
foreach ($nums as $k => $v) {
$success[$k] = $this->set((string) $k, $v, $expire);
Expand Down

0 comments on commit 87ff6c5

Please sign in to comment.