You didn't specified where the error is (line 7 does not say nothing as we are not inside your development environment), but it is clear that you
foreach
loop has a syntax error that leads to the exact same error...
See PHP
foreach[
^] page...
The loop should look like this:
foreach ($RESPONSE->LINE as $line){
echo $line;
}