php-markdown icon indicating copy to clipboard operation
php-markdown copied to clipboard

pass by reference?

Open fruitl00p opened this issue 11 years ago • 1 comments

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?

fruitl00p avatar May 06 '14 20:05 fruitl00p

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).

michelf avatar May 06 '14 20:05 michelf