How can the parse error in the PHP script be resolved, specifically related to unexpected T_VARIABLE on line 8?

The parse error related to unexpected T_VARIABLE on line 8 typically occurs when a variable is not properly defined or used in the PHP script. To resolve this issue, check for any syntax errors such as missing semicolons or incorrect variable names in the code. Make sure that variables are properly declared before using them in the script.

<?php
$variable1 = "Hello";
$variable2 = "World";

echo $variable1 . " " . $variable2;
?>