View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000406 | Xdebug | Step Debugging | public | 2008-08-27 19:02 | 2020-03-12 17:36 |
| Reporter | cheesegrits | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Fixed in Version | 2.3.0 | ||||
| Summary | 0000406: Need to see PHP defines/constants | ||||
| Description | Need to be able to see values of PHP defines in debug. | ||||
| Tags | No tags attached. | ||||
| Operating System | |||||
| PHP Version | 5.2.4 | ||||
|
|
I don't know what you mean here, can you clarify? |
|
|
I believe that the users wants to be able to see the values of any constants that are defined. For example, if I make the following define: define('MY_CONSTANT','xyz'); It would be good to be able to retrieve the value of MY_CONSTANT through Xdebug. As far as I know, this is not currently possible (i.e. not support by "context_get", "property_get", etc...). |
|
|
Yes, that's exactly what I meant. -- hugh |
|
|
I agree it would be great - is it possible with PHP though? |
|
|
It should be possible, but I don't know enough about PHP internals to see exactly how to do it. One problem is that the defined constants appear to live in a single If someone can tell me where PHP stores this set of names and values, it |
|
|
You mean like "get_defined_constants": |
|
|
Yes. What would the C code using the PHP API be to do that? |
|
|
Just to sketch out what I have in mind, all in #define DBGP_CONTEXT_LOCALS 0 DBGP_FUNC(context_names) static int attach_context_vars(...) { I've only gotten my toe wet with the PHP internals, but |
|
|
User defined constants, as defined with define() are now included in context 2 ("User defined constants"). |
|
|
Xdebug now supports debugging user-defined constants. The constants will appear in "context" 2 with context_get (http://xdebug/docs-dbgp.php#id52) and this is also reflected in the context_names (http://xdebug/docs-dbgp.php#context-names) command. It is also possible to call "property_get -c 2 -n ... to fetch the value. The returned property information will have the facet set to "constant". |