If you want to use phpdbg
console:
1) Create file named .phpdbginit
into the working directory from which you call phpdbg
. File contents:
<:
extract(array("_SERVER" => array("foo" => "bar")));
:>
2) Start debugging console phpdbg -e PATH/TO/SCRIPT/NAME.php
. For example phpdbg -e index.php
3) Test if it works using command ev $_SERVER
For me with php 5.6.12 and phpdbg v0.4.0, it prints:
root@host:/var/www/html# cat .phpdbginit
<:
extract(array("_SERVER" => array("foo" => "bar")));
:>
root@host:/var/www/html# phpdbg -e index.php
[Welcome to phpdbg, the interactive PHP debugger, v0.4.0]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://github.com/krakjoe/phpdbg/issues>]
[Attempting compilation of /var/www/html/index.php]
[Success]
phpdbg> ev $_SERVER
Array
(
[foo] => bar
)