Edit report at http://bugs.php.net/bug.php?id=53267&edit=1

 ID:                 53267
 User updated by:    enygma at phpdeveloper dot org
 Reported by:        enygma at phpdeveloper dot org
 Summary:            Pass by reference on "new" throws no deprecation
                     notice
 Status:             Bogus
 Type:               Bug
 Package:            *General Issues
 Operating System:   Linux
 PHP Version:        5.3.3
 Block user comment: N

 New Comment:

One problem with that...I have another example that uses ereg (it's a
PHP 5.3 examples thing) and at E_ALL I *do* get a deprecated message on
the same system. It's a CentOS virtual instance with the PHP packages
installed.


Previous Comments:
------------------------------------------------------------------------
[2010-11-08 21:37:52] [email protected]

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 ...

------------------------------------------------------------------------
[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

Reply via email to