Re: Count how many times a value occurs in an array [message #179274 is a reply to message #179273] |
Thu, 27 September 2012 21:52 |
M. Strobel
Messages: 386 Registered: December 2011
Karma:
|
Senior Member |
|
|
Am 27.09.2012 20:07, schrieb Christoph Becker:
> M. Strobel wrote:
>> Be careful with call-by-reference, it is not allowed in the newest PHP versions.
>
> Only the call-time call-by-reference was deprecated in 5.3 and removed
> in 5.4. Declaring a parameter of a function as reference is absolutely
> fine.
>
> E.g.:
>
> function increase(&$n)
> {
> $n++;
> }
>
> $i = 1; increase($i); // $i == 2
> $i = 1; increase(&$i); // fatal error in PHP 5.4
>
Yes, but I had a problem with callback functions: if you created them with
create_function this was a call-time call-by-reference.
/Str.
|
|
|