A better(presumably faster, easier to write) substitute (for php >= 5) is:
<?php
if (! function_exists("array_fill_keys")) {
function array_fill_keys(array $keys, $value) {
return array_combine($keys, array_fill(0, count($keys), $value));
}
}
// simple testcase
(array_fill_keys(array(1, 3, 2, "a", "b"), 42) === array(1 => 42, 3 => 42, 2 => 42, "a" => 42, "b" => 42)) or die("testcase 1 of array_fill_keys failed.");
?>