Is it possible to dump all global variables in a PHP script? Say this is my code:
<?php
$foo = 1;
$bar = "2";
include("blah.php");
dumpall();
// displays $foo, $bar and all variables created by blah.php
Also, is it possible to dump all defined constants in a PHP script.
Use get_defined_vars
and/or get_defined_constants
$arr = get_defined_vars();
print_r($arr);