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

"data-exptxt" empty when used inside a loop

Open twistedpixel opened this issue 6 years ago • 1 comments

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.

twistedpixel avatar Apr 17 '19 17:04 twistedpixel

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.

digitalnature avatar Jan 28 '20 21:01 digitalnature