Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New sniff: remove new by reference #10

Open
jrfnl opened this issue Jul 16, 2018 · 0 comments
Open

New sniff: remove new by reference #10

jrfnl opened this issue Jul 16, 2018 · 0 comments

Comments

@jrfnl
Copy link
Member

jrfnl commented Jul 16, 2018

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant