Download & Extend

php5 compatibility: array_fill_keys substitution (if necessary)

Project:Graphviz Filter
Version:6.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

as of "array_fill_keys" help page in php site, there's a contribution by matrebatre stating that this function is the same as "$array = array_combine($keys,array_fill(0,count($keys),$value));"... if it's true, you can achieve php5 compatibility adding the following script (it would be better to place this script in a sort of "heading" place, calling it just one time if possible):

//---- begin script ------------------------------------------
if (!function_exists('array_fill_keys')) {
   function array_fill_keys($keys,$value) {
      return array_combine($keys,array_fill(0,count($keys),$value));
   }
}
//---- end script ------------------------------------------

it immediatly clear that the script above create a new function only if necessary, that is when the original one isn't found.

if you notice that in some cases the equivalence stated is not fully correct, just modify the script above accordingly.

Comments

#1

Status:needs review» postponed

I'm planning to revisit the design of Graphviz Filter. I might not need that patch then.

#2

Status:postponed» fixed

Fixed in 6.x-1.3. The module no longer needs that function.

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here