Se per qualche motivo usate la reflection o la call_user_func e dovete sfruttare una funzione PHP che gestisce le variabili by reference ... ma non vi lascia impostarle come volete causa WARNING ... questo è l'unico modo che ho trovato per raggirare l'assurdità in questione
codice:function unshift(){ for($ref = new ReflectionFunction('array_unshift'), $args = array(&$this->array), $arguments = func_get_args(), $i = 0, $length = count($arguments); $i < $length; $i++) $args[] = $arguments[$i]; return $ref->invokeArgs($args); }
mentre se usate il codice da me postato in questa pagina avrete qualche problema ... che son sicuro non risolveranno
[edit]
quick and dirty e probabilmente slower ...
codice:function unshift(){ $ref = new ReflectionFunction('array_unshift'); $arguments = func_get_args(); return $ref->invokeArgs(array_merge(array(&$this->arr), $arguments)); }![]()




Rispondi quotando