What is the difference between using single and double quotes for variable interpolation in PHP session variable names?

When using single quotes for variable interpolation in PHP session variable names, the variable name will not be replaced with its value. This is because single quotes do not allow for variable interpolation. To properly interpolate variables in session variable names, double quotes should be used instead.

// Incorrect usage with single quotes
$_SESSION['user_id'] = 123;

// Correct usage with double quotes
$_SESSION["user_id"] = 123;