Closed simoami closed 9 years ago
Hi @simoami. Thanks for the report. I'm not able to reproduce this -- can you let me know when you're seeing that notice and what PHP version you're running?
v5.2.8
The array_merge function prior to 5.3.0 only supports integers. See changelog. So I used a custom function instead.
protected function my_array_reduce($array, $callback, $initial=null) {
$acc = $initial;
foreach($array as $a)
$acc = $callback($acc, $a);
return $acc;
}
protected function siw_get_cache_key() {
$data = self::my_array_reduce( func_get_args(), 'array_merge', array());
ksort( $data );
return 'siw_' . md5( json_encode( $data ) );
}
Thanks for helping identify that so quickly, @simoami! When I get a chance, I'll likely just replace the array_reduce
call with a loop. In the meantime, I may need to locate a machine with PHP 5.2 on it!
sounds good. Thanks for looking into it!
No problem. I forgot this was still open. The last release (4.2.1) should have fixed it, but let me know if you're still having any issues.