Supported Versions: PHP 5, PHP 7, PHP 8
Creates an array by using one array for keys and another for its values
<?php array_combine(array $keys, array $values): array
<?php return array_fill_keys($keys, null);
}
return array_combine($keys, $values);
}
<?php $items = array_map($callback, $array);
}
return array_combine($keys, $items);
}
<?php public function combine($values)
{
return new static(array_combine($this->all(), $this->getArrayableItems($values)));
}
<?php }
return $this->getArrayableItems(
array_combine($this->appends, $this->appends)
);
}
<?php return $models;
}
return array_combine(array_map(function ($model) {
return (new $model)->getTable();
}, $models), $models);
}
<?php if ($extensions) {
$keys = array_map([Str::class, 'snake'], array_keys($extensions));
$extensions = array_combine($keys, array_values($extensions));
}
$this->extensions = array_merge($this->extensions, $extensions);
<?php if ($replacers) {
$keys = array_map([Str::class, 'snake'], array_keys($replacers));
$replacers = array_combine($keys, array_values($replacers));
}
$this->replacers = array_merge($this->replacers, $replacers);
<?php return false;
}
return array_combine($this->columnNames, $values);
}
<?php $keys[$index] = strtolower($column->getName());
$values[$index] = $column;
return array_combine($keys, $values);
}
<?php if (!empty($data['available-packages'])) {
$availPackages = array_map('strtolower', $data['available-packages']);
$this->availablePackages = array_combine($availPackages, $availPackages);
$this->hasAvailablePackageList = true;
}
<?php 'ssh://[user@]host.xz[:port]/path/to/repo.git/',
);
return array_combine($urls, array_map(function ($e) {
return array($e);
}, $urls));
}
<?php 'git://5.6.7.8/git.git',
);
return array_combine($urls, array_map(function ($e) {
return array($e);
}, $urls));
}
<?php })));
self::assertCount(count(array_filter($expectedLibraries)), $libraries, sprintf('Expected: %s, got %s', var_export($expectedLibraries, true), var_export($libraries, true)));
$expectations = array_merge($expectations, array_combine(array_map(function ($extension) {
return 'ext-'.$extension;
}, $extensions), array_fill(0, count($extensions), array($extensionVersion, array(), array()))));
foreach ($expectations as $packageName => $expectation) {
list($expectedVersion, $expectedReplaces, $expectedProvides) = $expectation;
<?php $this->dumpKeys = false;
$this->value = $values[0]->value;
} else {
$this->value = array_combine($params, $values);
}
}
<?php foreach ($prefixedKeys as $i => $k) {
$keys[$i] = $k;
}
$a = array_combine($keys, $a);
}
}