Topic: Setting _SERVER and _REQUEST in runkit sandbox
Hello everyone,
I'm trying to set these two variables, $_SERVER and $_REQUEST in runkit's sandbox.
I've installed these two packages on a Centos OS 6,
php-cli.x86_64 0:5.5.32-1.el6.remi
php-pecl-runkit.x86_64 0:1.0.4-1.el6.remi.55
from the remi-php55 repo.
Then, with these two files,
test.php:
<?php
$sandbox = new Runkit_Sandbox();
$sandbox->_SERVER = ['a' => 'b'];
$sandbox->_REQUEST = ['c' => 'd'];
$sandbox->include('./dump.inc');
// end of test.php
dump.inc:
<?php
var_dump($_SERVER, $_REQUEST);
// end of dump.inc
when I run zts-php test.php, I expect to see
array(1) {
'a' =>
string(1) "b"
}
array(1) {
'c' =>
string(1) "d"
}
but I only get
array(4) {
["REQUEST_TIME_FLOAT"]=>
float(1456604014.3054)
["REQUEST_TIME"]=>
int(1456604014)
["argv"]=>
array(0) {
}
["argc"]=>
int(0)
}
array(0) {
}
Besides those two variables, other superglobals I need to set do accept change ($_POST, $_GET, $_COOKIE and $_FILES).
What can I do to make this behave as I expected?