variable variables cannot be used with PHP's Superglobal arrays within functions or class methods. Demo
Refer to php doc Variable variables
Please note that variable variables cannot be used with PHP's
Superglobal arrays within functions or class methods. The variable
$this is also a special variable that cannot be referenced
dynamically.