Page MenuHomePhabricator

[tools/code-utils] check-vars.php: Add optional warning to passing $this by reference
Closed, DeclinedPublicFeature

Description

Passing objects by reference isn't necessary in PHP5. I imagine it would be hard to check for any var that is an object to warn for pass-by-ref, but checking for the special case of $this should be easier.

Make it optional, because I know there's a lot of violators of the rule (and it's not strictly harmful)


Version: unspecified
Severity: enhancement

Details

Reference
bz29300

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:27 PM
bzimport set Reference to bz29300.
bzimport added a subscriber: Unknown Object (MLST).

So, you want a warning whenever the tokens & $this appear?

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:00 AM
Aklapper removed a subscriber: wikibugs-l-list.
PleaseStand subscribed.

check-vars.php was removed; see T326292.