What is the error in the code snippet provided that prevents the variable $version from being displayed correctly?

The error in the code snippet is that the variable $version is being incorrectly accessed within the double quotes of the echo statement. In PHP, variables inside double quotes should be enclosed in curly braces to be evaluated correctly. To fix this issue, the variable $version should be enclosed in curly braces within the echo statement.

// Incorrect code snippet
$version = "1.0";
echo "Current version is $version";

// Corrected code snippet
$version = "1.0";
echo "Current version is {$version}";