Voting

: max(five, seven)?
(Example: nine)

The Note You're Voting On

joe at theuerkauf dot dev
1 month ago
Example 2 states the statement pairs are equivalent.

This is true only of the modified array. The *returns* from these pairs will never be equivalent.

The return of array_splice() is *always* an array of extracted values, even when nothing (empty array) or only 1 value is extracted.

<?php
$arr
= [1, 2, 3, [4]];

$pop = $arr;
array_pop($pop): // [4]
$splice = $arr;
array_splice($splice, -1); // [ [4] ]

$unshift = $arr;
array_unshift($unshift, 'foo'): // 5
$splice = $arr;
array_splice($splice, 0, 0, 'foo'); // [ ]
?>
etc.

<< Back to user notes page

To Top