Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE)

I am facing this error on Lumen 8
I start getting this error after switching from apache to LightSpeed
Its php version error not related to the server but LightSpeed Doesnt have php 8.2 So I am using php 8.1 in light speed

Any Solution for this?