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: Open +Status: Bogus Type: Bug Package: *General Issues Operating System: linux, debian PHP Version: 5.3.3RC3 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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