Bug #52400 [Bgs->Tbd]: Object 'named' constructor not called in namespaces only

From: Date: Thu, 22 Jul 2010 08:17:25 +0000
Subject: Bug #52400 [Bgs->Tbd]: Object 'named' constructor not called in namespaces only
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-152607@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52400&edit=1 ID: 52400 Updated by: pajoye@php.net Reported by: mat999 at gmail dot com Summary: Object 'named' constructor not called in namespaces only -Status: Bogus +Status: To be documented Type: Bug -Package: *General Issues +Package: Scripting Engine problem Operating System: linux, debian PHP Version: 5.3.3RC3 New Comment: @doc Can you check if it is in there already as well as in the manual? Previous Comments: ------------------------------------------------------------------------ [2010-07-22 10:09:00] mat999 at gmail dot com Thanks for the quick reply, can I recomend adding this to the UPGRADING document? ------------------------------------------------------------------------ [2010-07-22 10:01:36] pajoye@php.net By design, bug fix. Methods with the same name as the last element of a namespaced class name will not be treated as constructor anymore. This change doesn't affect non-namespaced classes. Use the recommended __construct instead. ------------------------------------------------------------------------ [2010-07-22 09:58:43] mat999 at gmail dot com Description: ------------ Very big bad bug, suprised it escaped test until now. Only tested on php-fpm, not cli. Test script: --------------- namespace NS1 { class Test { function Test($t){ die('called'); } } } namespace { new \NS1\Test($t); die(':('); } Expected result: ---------------- called Actual result: -------------- :( ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52400&edit=1

« previous php.bugs (#152607) next »