Consider the following code snippets:
Figure A:
$_REQUEST = json_decode(stripslashes(json_encode($_REQUEST, JSON_HEX_APOS)), true);
Figure B:
${'_REQUEST'} = json_decode(stripslashes(json_encode(${'_REQUEST'}, JSON_HEX_APOS)), true);
Illustration C:
${'_' . 'REQUEST'} = json_decode(stripslashes(json_encode(${'_' . 'REQUEST'}, JSON_HEX_APOS)), true);
Both demonstrate A and B work fine, demonstrate C , but they display a very strange error message:
Note: Undefined variable: _REQUEST
What's even weirder is that this only happens with a supervalve $_REQUESTif I try it with $_GET, $_POSTor $_COOKIE, all experiments work fine without raising error notifications.
I assume this is a PHP error? I work for PHP 5.3.0.
source
share