-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Sniff basics | - |
---|---|
Fixable for PHP: | 5.0+ |
Sniff type: | Modernize |
Fixer type: | Safe |
Short description
Assigning the return value of new
by reference is a PHP4-style practice and is not needed in PHP 5 were objects are always passed by reference.
Related PHPCompatibility sniff(s):
DeprecatedNewReference
PHP manual references:
- http://php.net/manual/en/language.operators.assignment.php#language.operators.assignment.reference
- http://php.net/manual/en/migration53.deprecated.php
Example code:
Detect the following code pattern(s):
$o = &new C;
And fix these to:
$o = new C;