demon_goo
Новичок
PHP 5.3: call_user_func_array propagates $this...
"call_user_func() now propagates $this even if the callee is the parent class"
Если кто-нибудь понимает, что означает эта фраза (взята из back imcompatibility для PHP 5.3), объясните, пожалуйста. Я понимаю отдельные слова но в целом - нет.
Конкретно для меня это вылилось что рабочий на 5.2 код выдаёт Segfault на 5.3, код такого вида:
Вот в этой ссылке на http://bugs.php.net/ товарищ тоже встретился с такой проблемой и в последнем комменте даже есть решение:
)
"call_user_func() now propagates $this even if the callee is the parent class"
Если кто-нибудь понимает, что означает эта фраза (взята из back imcompatibility для PHP 5.3), объясните, пожалуйста. Я понимаю отдельные слова но в целом - нет.
Конкретно для меня это вылилось что рабочий на 5.2 код выдаёт Segfault на 5.3, код такого вида:
PHP:
class A {}
class B extends A
{
public function __construct()
{
$args = func_get_args();
call_user_func_array(array($this, 'parent::__construct'), $args);
}
}
class C extends B
{
}
$instance = new B(); // работает
$instance = new C() // падает в Segfault
Но... я не могу понять - ПАЧИМУ!Thanks for the report. From the UPGRADING:
call_user_func() now propagates $this even if the callee is
the parent class
This includes the class to which the call is relative, might not be
clear from the entry.
The fix for the code would be replacing parent::x with A::x.
)
