Supported Versions: PHP 5 >= 5.2.0, PHP 7, PHP 8
Fill an array with values, specifying keys
<?php array_fill_keys(array $keys, mixed $value): array
<?php }
if ($this->memcached->getResultCode() != 0) {
return array_fill_keys($keys, null);
}
return array_combine($keys, $values);
<?php {
preg_match_all('/(?<={).*?(?=})/', $route->uri, $matches);
$fields = array_fill_keys($matches[0], null);
$route->setBindingFields(array_replace(
$fields, array_intersect_key($bindingFields, $fields)
<?php {
preg_match_all('/\{(\w+?)\?\}/', $this->uri(), $matches);
return isset($matches[1]) ? array_fill_keys($matches[1], null) : [];
}
<?php return true;
}
return empty(array_diff_key($value, array_fill_keys($parameters, '')));
}
<?php }
return array_merge(
array_fill_keys(array_keys($require), 'require'),
array_fill_keys(array_keys($requireDev), 'require-dev')
);
}
<?php return array_merge(
array_fill_keys(array_keys($require), 'require'),
array_fill_keys(array_keys($requireDev), 'require-dev')
);
}
<?php public function testItComparesLargeData()
{
$howMany = 700;
$data = array_fill_keys(range(0, $howMany), ['a', 'b', 'c', 'd']);
$expected = sprintf("array:%d [\n", $howMany + 1);
for ($i = 0; $i <= $howMany; ++$i) {