|
Тема |
Re: Flyspray - bugtracking system [re: JWalker] |
|
Автор |
edembg (Ученик) |
|
Публикувано | 07.09.10 16:48 |
|
|
Опитай така
E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED)
http://php.net/manual/en/language.references.php
After hours of confusion and reading tons of posts I finally figured out that replacing PHP 4 style object creation, where new is assigned by reference:
$node_obj =& new someClass($somearg, $moreargs);
which in PHP 5.3.0 generates an E_STRICT message telling you that "Assigning the return value of new by reference is deprecated"
with the following, where & has been removed:
$node_obj = new someClass($somearg, $moreargs);
in some cases (at least in recursive loops while creating a tree of nodes containing child nodes) requires
unset($node_obj);
before the actual object assignment line to avoid all child nodes becoming identical.
Hope that delicate piece of information will save someone else a few hours.
Проблема е, че ако не са забранени грешки E_DEPRECATED и E_USER_DEPRECATE за всяко
$var = new Class();
ще има съобщение за грешка. Ако се промени така
$var = &new Class();
вече няма да има грешка, но това е много трудоемко и безмислено да се прави.
Успех.
И най-ярките личности си плащат тока.
|
| |
|
|
|