As it said in the PHP manual about array_unshift()
function:
7.3.0 This function can now be called with only one parameter. Formerly, at least two parameters have been required.
I didn't get it. How to use such function with only one parameter?
I tried to guess, but nothing happens:
$arr = ['one' => 'test', 'two' => 'some'];
array_unshift($arr);
print_r($arr);
// Result:
// Array
// (
// [one] => test
// [two] => some
// )
$arr1 = ['what', 'ever'];
array_unshift($arr1);
print_r($arr1);
// Array
// (
// [0] => what
// [1] => ever
// )
The arrays haven't changed.
Does anyone know what exactly PHP contributors suggest?
php::count()
do that job in the explicit way. I'm pretty sure that authors didn't want to provide to us another strange method for counting the array :) – Loveinidleness