Skip to content

New sniff: remove new by reference #10

@jrfnl

Description

@jrfnl
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:

Example code:

Detect the following code pattern(s):

$o = &new C;

And fix these to:

$o = new C;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions