I have the problem that I get the error
PHP Fatal error: Call-time pass-by-reference has been removed in....
I discovered some similar questions e.g.
But nothing offers a reals answers how situations be can solved where you NEED to declare the passed value as refference by runtime for e.g. buildin function which you cant change function declaration ??.
e.g. for this example third array_walk parameter as reference: ?
I tried to use this solution to change the indexes of my array with this code:
function __reindex(&$v,$k, &$aReindexed)
{
$kNew = $k+100;
$aReindexed[$kNew] = $v;
}
$aTest = array(4,"f","_","test");
array_walk($aTest,"__reindex", &$aReindexed );
The Code without the refference is not working (the new array is not changed and stays empty).
And the Code with the refference it works, but not in php 5.4 and higher.
So whats the way so handle such situations ?
p.s. if anybody likes to say "declare the $k variable in your __reindex function as refference" then that wont work (that was the first way I tried)