function d($arg) { $declared = 'variable'; ChromePhp::log('xdebug_get_declared_vars', xdebug_get_declared_vars()); ChromePhp::groupCollapsed('backtrace'); ChromePhp::log(debug_backtrace()); ChromePhp::groupEnd(); ChromePhp::info('Triggered notice.'); trigger_error('Custom notice', E_USER_NOTICE); ChromePhp::warn('Triggered warning.'); trigger_error('Custom warning', E_USER_WARNING); ChromePhp::error('Triggered error.'); trigger_error('Custom error', E_USER_ERROR); }
function s() { $c = 42; $d = 54; echo $c, $d, "\n"; var_dump(xdebug_get_declared_vars()); }
public final function virtual_sites() { $submitted = $this->Request('submitted'); $file = $this->Request('file'); $_file = $this->sites_avail . '/' . $file; $this->save_nginx_conf(); $this->enable_disable_site($submitted, $file); if ($this->Submitted($submitted) == 'load' and !strstr($file, ';')) { $which = $this->IsFileThere($this->sites_enabled . '/' . $file, '-h'); $buttons = !$which ? '<span id="buttons"><button name="' . $file . '" id="disabled">Enable Site</button></span> | ' : '<button name="' . $file . '" id="enabled">Disable Site</button></span> | '; if ($this->IsFileThere($this->sites_avail . '/' . $file)) { $this->nginx_conf_filename = $this->sites_avail . '/' . $file; if ($this->config_file_to_array()) { $this->config_array_to_html(); $this->js_selects(); } } foreach (xdebug_get_declared_vars() as $val) { $log .= "{$val} = {${$val}}\n"; } $this->ErrorLog($log); } $site_filename = $this->nginx_conf_filename; $site_list = $this->build_site_list(); require_once $this->Page(__METHOD__); }
function d($arg) { $declared = 'variable'; var_dump(xdebug_get_declared_vars()); trigger_error('Custom notice', E_USER_NOTICE); trigger_error('Custom warning', E_USER_WARNING); trigger_error('Custom error', E_USER_ERROR); }
function d($arg) { $firephp = FirePHP::getInstance(TRUE); $declared = 'variable'; $firephp->log(xdebug_get_declared_vars(), 'xdebug_get_declared_vars'); $firephp->trace('Trace'); $firephp->info('Triggered notice'); trigger_error('Custom notice', E_USER_NOTICE); $firephp->warn('Triggered warning.'); trigger_error('Custom warning', E_USER_WARNING); $firephp->error('Triggered error.'); trigger_error('Custom error', E_USER_ERROR); }
/** * Loads a PHP sourcefile. * * When the Xdebug extension is loaded and its "xdebug.collect_vars" * configuration directive is enabled, all global variables declared * in the loaded PHP sourcefile will be added to $GLOBALS. * * @param string $filename * @access protected * @static * @since Method available since Release 3.0.0 */ protected static function load($filename) { $xdebugLoaded = extension_loaded('xdebug'); $xdebugCollectVars = $xdebugLoaded && ini_get('xdebug.collect_vars') == '1'; if ($xdebugCollectVars) { $variables = xdebug_get_declared_vars(); } include_once $filename; if ($xdebugCollectVars) { $variables = array_values(array_diff(xdebug_get_declared_vars(), $variables)); foreach ($variables as $variable) { if (isset(${$variable})) { $GLOBALS[$variable] = ${$variable}; } } } }
function func1inner1() { $func2var = true; var_dump(xdebug_get_declared_vars()); }
/** * Returns an array where each element is a variable name which is defined in the current scope. * @return array */ public function getDeclaredVars() { return xdebug_get_declared_vars(); }
<?php var_dump(xdebug_get_declared_vars());