array_splice()
function array_splice(array $array, int $offset, int $length = null, array $replacement = []): array
Removes a portion of the array and replaces it with something else.
Parameters:
$array(array), passed by reference$offset(int)$length(int), defaultnull, optional$replacement(array), default[], optional
Returns: array
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/array/array_splice.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how array_splice is implemented in the compiler, see the internals page.