Edit report at http://bugs.php.net/bug.php?id=52400&edit=1
ID: 52400 Updated by: paj...@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] paj...@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