php-ref
php-ref copied to clipboard
"data-exptxt" empty when used inside a loop
Seems like "data-exptxt" only gets set once when r() is used inside a loop. For example:
foreach([1,2,3,4,5] as $n) { r($n); }
The result of the above code is that only the first output has "data-exptxt" set. All others do not.
Yes, this is a expected behavior and caused by static $lineInst = array();
I don't think it's necessary to display the same expression multiple times in such cases.
But if you want this, just remove the static keyword in the code above.