[xdebug-general] Re: 2 Queries about XDebug 2.0.0rc1

From: Derick Rethans <derick[@]xdebug.org>
Date: Fri, 20 Oct 2006 08:51:02 +0200 (CEST)

On Wed, 18 Oct 2006, Dave Kelsey wrote:

> I guess I am confused about the scope of PHP variables. With a Stack
> structure of
> Main
> Level 1
> Level 2
> Level 3
> I want to show the variables that are accessible at that stack level
> so if I click on Main, I want to show all the local variables at that
> context level plus the super globals, anything else declared as
> global.

Xdebug only shows which variables are actually *used* in a scope. If you
have a $_GET in your function it should show up in the local vars list
as well.

> If I click on Level 3, I want to show all the local variables for that
> context plus the super globals, plus anything declared as global.

If you use the "global" keyword, a local reference to the global
variable is made introducing the variable as a local variable.

> But my local variables in Main get in included on the global
> context_get (which also includes the super globals), but as my php
> code shows at level 3, the superglobals are available, the local
> variables are available and any explicitly defined variables are
> available but not the local variables defined at main. But XDebug has
> included these variables so I present a list of local variables in
> Main + Super globals, plus the context variables are level 3, but the
> local variables in Main are not accessible, so I currently have to
> explicitly remove them from my presentation in order to provide the
> correct list of exposed variables at the appropriate level.
> Does this make sense ?

Yes, I guess the "Globals" should just contain the super globals then
only. I just committed a patch that should do just that.

> (Sorry about the top-post, what is the preferred way to post replies ?)

bottom or inline-replies.


Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
Received on Fri Oct 20 2006 - 08:51:37 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST