Bloke / smd_xml

A Textpattern CMS plugin for reading and parsing XML data
GNU General Public License v2.0
2 stars 2 forks source link

Deprecated unparenthesized expressions in PHP 7.4 #2

Open jools-r opened 2 years ago

jools-r commented 2 years ago

I get the following message in debugging mode only with txp-9-dev and PHP 7.4:

A problem occurred while loading the plugin: smd_xml (0.4.3) -> 8192: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence on line 926

Not sure if this refers to the plugin itself or the loading method within Textpattern. I don't see anything relevant on line 926 – possibly on line 997…

https://github.com/Bloke/smd_xml/blob/a18a9c9402164219b707d58653060db20ea7d773/smd_xml.php#L997

… but if so very minor.

Bloke commented 2 years ago

Guess it just needs $treeOffset = '-' .($treeSize - 1);. No change to the code logic, as that's the intended outcome anyway, it should just silence the warning.