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

pass by reference? #163

Open
fruitl00p opened this issue May 6, 2014 · 1 comment
Open

pass by reference? #163

fruitl00p opened this issue May 6, 2014 · 1 comment

Comments

@fruitl00p
Copy link

Might be an issue, might not, but haven't seen any mentioning of it here: I've run the PHPCompatibility Codesniffer and have this found the usage of i.e. $this->doExtraAttributes("h$level", $dummy =& $matches[2]); as Using a call-time pass-by-reference is prohibited since php 5.4 (doing a quick search for $dummy finds all occurences)

If i'm not mistaken the use of $dummy in all those cases is superfluous is it not?

@michelf
Copy link
Owner

michelf commented May 6, 2014

No issue here. That's not a call-time pass by reference. $dummy =& $matches[2] is a reference assignment of $matches[2] to local variable $dummy, local variable which is then passed as an argument to doExtraAttributes. The reason I'm doing it this way is to avoid the more complicated expression (isset($matches[2]) ? $matches[2] : null).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants