PHP 8.x: "Implicit conversion from float xxx to int loses precision" in TCPDF::Write() line 6411 - unncecessary/pointless array_walk($chrw, array($this, 'getRawCharWidth'));? #599
On PHP 8.x I get the deprecation message "Implicit conversion from float xxx to int loses precision" when writing a line via TCPDF::Write()
It traces back to array_walk($chrw, array($this, 'getRawCharWidth')); which seems rather pointless to me. getRawCharWidth() expects parameter to be an character code (ord), but $chrw already contains calculated character widths and getRawCharWidth() would only return the character width and does not store anything or modify the original value via reference. So array_walk does nothing, if I understand correctly.
Comparing $chrw before and after array_walk also yields same result.
On PHP 8.x I get the deprecation message "Implicit conversion from float xxx to int loses precision" when writing a line via TCPDF::Write()
It traces back to
array_walk($chrw, array($this, 'getRawCharWidth'));
which seems rather pointless to me.getRawCharWidth()
expects parameter to be an character code (ord), but$chrw
already contains calculated character widths andgetRawCharWidth()
would only return the character width and does not store anything or modify the original value via reference. So array_walk does nothing, if I understand correctly. Comparing$chrw
before and after array_walk also yields same result.