Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #1262: overload_var_dump=0 messes with xdebug_var_dump() #258

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/bug01262.phpt
@@ -0,0 +1,16 @@
--TEST--
Test for bug #1262: overload_var_dump=0 messes with xdebug_var_dump()
--INI--
xdebug.default_enable = 1
xdebug.overload_var_dump = 0
html_errors = 1
--FILE--
<?php
xdebug_var_dump("Anything");
echo "\n";
var_dump("Anything");
?>
--EXPECT--
<pre class='xdebug-var-dump' dir='ltr'><small>string</small> <font color='#cc0000'>'Anything'</font> <i>(length=8)</i>
</pre>
string(8) "Anything"
14 changes: 12 additions & 2 deletions xdebug.c
Expand Up @@ -2190,8 +2190,18 @@ PHP_FUNCTION(xdebug_var_dump)
int argc;
int i, len;
char *val;

if (!XG(overload_var_dump)) {

/* Ignore our new shiny function if overload_var_dump is set to 0 *and* the
* function is not being called as xdebug_var_dump() (usually, that'd be
* the overloaded var_dump() of course). Fixes issue 1262. */
if (
!XG(overload_var_dump)
#if PHP_VERSION_ID >= 70000
&& (strcmp("xdebug_var_dump", execute_data->func->common.function_name->val) != 0)
#else
&& (strcmp("xdebug_var_dump", EG(current_execute_data)->function_state.function->common.function_name) != 0)
#endif
) {
XG(orig_var_dump_func)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
return;
}
Expand Down