What are the drawbacks of using $_SESSION["user_id"] within single quotes in PHP code?

Using $_SESSION["user_id"] within single quotes in PHP code will not correctly access the value stored in the session variable. To fix this issue, you should use double quotes to correctly interpolate the session variable within the string.

// Incorrect usage within single quotes
$userId = '$_SESSION["user_id"]';

// Corrected usage within double quotes
$userId = $_SESSION["user_id"];