Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Merge one or more arrays
<?php array_merge(array ...$arrays): array
<?php {
$credentials = $this->basicCredentials($this->getRequest(), $field);
if (! $this->once(array_merge($credentials, $extraConditions))) {
return $this->failedBasicResponse();
}
}
<?php return false;
}
return $this->attempt(array_merge(
$this->basicCredentials($request, $field), $extraConditions
));
}
<?php {
if (method_exists($event, 'broadcastWith') &&
! is_null($payload = $event->broadcastWith())) {
return array_merge($payload, ['socket' => data_get($event, 'socket')]);
}
$payload = [];
<?php public function pusher(array $config)
{
$guzzleClient = new GuzzleClient(
array_merge(
[
'connect_timeout' => 10,
'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
'timeout' => 30,
],
$config['client_options'] ?? [],
),
);
$pusher = new Pusher(
<?php return [
'pending_jobs' => $batch->pending_jobs,
'failed_jobs' => $batch->failed_jobs + 1,
'failed_job_ids' => json_encode(array_values(array_unique(array_merge((array) json_decode($batch->failed_job_ids, true), [$jobId])))),
];
});
<?php public function map(array $map)
{
$this->handlers = array_merge($this->handlers, $map);
return $this;
}
<?php $this->dynamoDbClient->putItem([
'TableName' => $this->table,
'Item' => $this->marshaler->marshalItem(
array_merge(['application' => $this->applicationName], $batch)
),
]);
<?php public function appendToChain($job)
{
$this->chained = array_merge($this->chained, [$this->serializeJob($job)]);
return $this;
}
<?php $now = Carbon::now();
return array_merge(collect(array_flip($keys))->map(function () {
})->all(), collect($response['Responses'][$this->table])->mapWithKeys(function ($response) use ($now) {
if ($this->isExpired($response, $now)) {
$value = null;
} else {
$value = $this->unserialize(
$response[$this->valueAttribute]['S'] ??
$response[$this->valueAttribute]['N'] ??
null
);
}
return [Str::replaceFirst($this->prefix, '', $response[$this->keyAttribute]['S']) => $value];
})->all());
}
<?php $results[] = $values;
}
return array_merge([], ...$results);
}
<?php foreach ($array as $key => $value) {
if (is_array($value) && ! empty($value)) {
$results = array_merge($results, static::dot($value, $prepend.$key.'.'));
} else {
$results[$prepend.$key] = $value;
}
<?php public function merge($items)
{
return new static(array_merge($this->items, $this->getArrayableItems($items)));
}
<?php {
$arrayableItems = array_map(fn ($items) => $this->getArrayableItems($items), func_get_args());
$params = array_merge([fn () => new static(func_get_args()), $this->items], $arrayableItems);
return new static(array_map(...$params));
}
<?php $result = $initial;
foreach ($this as $key => $value) {
$result = call_user_func_array($callback, array_merge($result, [$value, $key]));
if (! is_array($result)) {
throw new UnexpectedValueException(sprintf(
<?php protected function createInputFromArguments(array $arguments)
{
return tap(new ArrayInput(array_merge($this->context(), $arguments)), function ($input) {
if ($input->getParameterOption('--no-interaction')) {
$input->setInteractive(false);
}