Skip to content

Commit

Permalink
Merge branch 'master' of github.com:xdebug/xdebug
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Feb 5, 2016
2 parents 96e3def + 7cbd98d commit 9070a50
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
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

0 comments on commit 9070a50

Please sign in to comment.