GeezerVison is showing github.com — Fix php_debugger.* INI aliases being silently ignored by pronskiy · Pull Request #32 · php-debugger/php-debugger
Conversation
pronskiy
commented
Mar 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
php_debugger.* INI aliases were silently ignored, and when both prefixes were set, ini_get("xdebug.*") did not reflect the php_debugger.* override.
Fixes #31
Changes
Fix alias detection during MINIT — entry->modified is always 0 during zend_register_ini_entries(). Added php_debugger_ini_is_explicitly_set() which falls back to zend_get_configuration_directive() for MINIT-stage detection.
Sync canonical entries — When a php_debugger.* alias is set, php_debugger_sync_canonical() updates the corresponding xdebug.* entry value directly, so ini_get("xdebug.foo") reflects the effective value.
php_debugger.* takes precedence — When both prefixes are set, the php_debugger.* value wins regardless of directive order.
Deduplicate wrappers — All 6 identical OnUpdatePhpDebugger* handlers replaced with a PHP_DEBUGGER_INI_WRAPPER macro.
Tests
ini_alias_client_host — DBGp session using only php_debugger.* prefix
ini_alias_idekey — php_debugger.idekey appears in DBGp init packet
ini_alias_precedence — php_debugger.* wins when set before xdebug.*
ini_alias_precedence_reverse — php_debugger.* wins when set after xdebug.*
ini_alias_precedence_ini_get — ini_get("xdebug.*") returns php_debugger.* values (mixed order)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The OnUpdatePhpDebugger* wrapper handlers used entry->modified to
decide whether to apply a value. During zend_register_ini_entries()
(MINIT stage), PHP always sets entry->modified=0 for newly registered
entries, even when the user explicitly set the value via -d or php.ini.
This caused all php_debugger.* settings to be silently ignored.
Replace the entry->modified check with a helper that also consults
zend_get_configuration_directive(), which correctly returns non-NULL
when the value was explicitly set.
Fixes #31
When php_debugger.* and xdebug.* are both set, php_debugger.* must
take precedence. The wrapper handlers already wrote to the correct
struct field, but ini_get("xdebug.foo") still returned the xdebug.*
value because each INI entry maintains its own value string.
Add php_debugger_sync_canonical() which directly updates the canonical
xdebug.* entry value string after a successful php_debugger.* update.
Uses zend_hash_find_ptr on EG(ini_directives) to avoid re-triggering
the canonical handler.
Three new tests verify precedence:
- ini_alias_precedence: php_debugger.* before xdebug.* in -d order
- ini_alias_precedence_reverse: xdebug.* before php_debugger.*
- ini_alias_precedence_ini_get: ini_get() reflects php_debugger.* values
for both xdebug.* and php_debugger.* names (mixed INI order)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
pronskiy reacted with heart emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.