Vster
(Lee)
26 July 2023 14:25
1
I update my EmonCMS instance from Github last week sometime, it worked fine and everything is up to date.
I just wanted to do something in the Postprocessing module and now get this -
Parse error : syntax error, unexpected ‘=>’ (T_DOUBLE_ARROW), expecting ‘)’ in /opt/emoncms/modules/postprocess/postprocess-module/postprocess_model.php on line 222
Is it just me? Or has a bug crept in?
Vster
(Lee)
27 July 2023 10:42
2
I’m surprised no one else has seen this error.
I wonder is @glyn.hudson or @TrystanLea could have a look please?
This is a known issue with PHP 7
opened 12:08AM - 05 Jul 23 UTC
I've just updated the latest version of postprocess on an emonPi running `emonSD… -21Jul21` with PHP Version 7.3.31-1~deb10u1` and I get the following error
`Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')' in /opt/emoncms/modules/postprocess/postprocess-module/postprocess_model.php on line 222`
This is the line in question which looks ok
`usort($processes, fn($a, $b) => $a['order'] <=> $b['order']);`
https://github.com/emoncms/postprocess/blob/master/postprocess-module/postprocess_model.php#L222C8-L222C70
However, on an emonPi running `emonSD-10Nov22` with `PHP Version 8.1.13` it works fine.
It will work if you update to PHP 8
I’ve fixed this one now, changed the line for php7 compatibility. Update in the latest master branch
1 Like