Edit report at http://bugs.php.net/bug.php?id=53267&edit=1
ID: 53267 Updated by: [email protected] Reported by: enygma at phpdeveloper dot org Summary: Pass by reference on "new" throws no deprecation notice -Status: Open +Status: Bogus Type: Bug Package: *General Issues Operating System: Linux PHP Version: 5.3.3 Block user comment: N New Comment: It issues an E_DEPRECATED, but in compile-time... E_DEPRECATED is not in the default error_reporting setting, so it doesn't displays the deprecated message. $ sapi/cli/php -derror_reporting=E_DEPRECATED foo.php Deprecated: Assigning the return value of new by reference is deprecated in ... Previous Comments: ------------------------------------------------------------------------ [2010-11-08 20:26:30] enygma at phpdeveloper dot org Description: ------------ I don't know if this is a documentation bug or an error in PHP, but I thought I'd bring it up. There's no warning raised when the pass by reference is used on a "new" in a class definition in PHP 5.3.3 (multiple testers). Docs are here: http://php.net/manual/en/migration53.deprecated.php Test script: --------------- Example code: <?php error_reporting(E_ALL|E_DEPRECATED); class MyClass { } $mc = &new MyClass(); ?> Expected result: ---------------- Expected: Deprecated notice Actual result: -------------- Actual: No warning raised ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53267&edit=1
