array_splice
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Remove a portion of the array and replace it with something else
array_splice
(
array
&
$array
,
int $offset
,
?
int $length
=
null
,
mixed $replacement
= []): array
public function
splice
(
$offset
,
$length
=
null
,
$replacement
= [])
{
if (
func_num_args
() ===
1
) {
return new static(
array_splice
(
$this
->
items
,
$offset
));
}
return new static(
array_splice
(
$this
->
items
,
$offset
,
$length
,
$this
->
getArrayableItems
(
$replacement
)));
src/Illuminate/Collections/Collection.php
return new static(
array_splice
(
$this
->
items
,
$offset
));
}
return new static(
array_splice
(
$this
->
items
,
$offset
,
$length
,
$this
->
getArrayableItems
(
$replacement
)));
}
src/Illuminate/Collections/Collection.php
{
$row
=
array_values
(
Arr
::
except
(
$failed
, [
'payload'
,
'exception'
]));
array_splice
(
$row
,
3
,
0
,
$this
->
extractJobName
(
$failed
[
'payload'
]) ?:
''
);
return
$row
;
}
src/Illuminate/Queue/Console/ListFailedCommand.php
protected function
spliceIntoParameters
(array &
$parameters
,
$offset
,
$value
)
{
array_splice
(
$parameters
,
$offset
,
0
, [
$value
]
);
}
}
src/Illuminate/Routing/RouteDependencyResolverTrait.php
protected function
moveMiddleware
(
$middlewares
,
$from
,
$to
)
{
array_splice
(
$middlewares
,
$to
,
0
,
$middlewares
[
$from
]);
unset(
$middlewares
[
$from
+
1
]);
src/Illuminate/Routing/SortedMiddleware.php