Page 1 of 1

Passing an array to a user function

Posted: 28 Oct 2022 07:52
by altoclef

Code: Select all

    $a = array("cat", "dog"); 
    echo count($a); 
    Test($a);

Code: Select all

function Test(&$array){
    echo count($array); 
}
The twocount()statements show 2 and -1.

This happens whether I pass the array by value or by reference.

What is wrong with my code, please?

Re: Passing an array to a user function

Posted: 18 Nov 2022 11:38
by admin
Nothing wrong with your code. :tup: That was my bug. :bug:

Fixed in next beta.

Re: Passing an array to a user function

Posted: 25 Nov 2022 11:20
by altoclef
I've tested this in v23.80 and confirm that it is fixed.

Thank you.