Page MenuHomePhabricator

xdebug causes bogus failures for <tag>-related parser tests
Closed, ResolvedPublic

Description

When I enable xdebug, I get the following 4 bogus failures http://p.defau.lt/?PIkfleT2gR1E_HKF3PDoZg

xdebug seems to be changing array key formatting on var_dump() (see ParserTestParserHook::dumpHook)) which is causing phpunit to claim there's a failure when there obviously isn't. Disabling xdebug makes the failures go away.

This may be something platform-specific (OSX 10.7.3, PHPUnit 3.6.10, PHP 5.3.8). Not sure if it's a real bug upstream or just some behavior we should work around.


Version: 1.20.x
Severity: normal

Details

Reference
bz36452

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:28 AM
bzimport set Reference to bz36452.
bzimport added a subscriber: Unknown Object (MLST).

Same platform. No issue :-]

Can you paste your xdebug version? php --version will tell something like:

with Xdebug v2.1.3, Copyright (c) 2002-2012, by Derick Rethans

It could be your xdebug configuration?

php -i | grep xdebug

xdebug
xdebug support => enabled
xdebug.auto_trace => Off => Off
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.idekey => amusso => no value
xdebug.manual_url => http://www.php.net => http://www.php.net
xdebug.max_nesting_level => 100 => 100
xdebug.overload_var_dump => On => On
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_output_dir => /var/tmp/ => /var/tmp/
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_autostart => Off => Off
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => Off => Off
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => no value => no value
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.scream => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /var/tmp/ => /var/tmp/
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3

No errors on a CentOS VM with php 5.3.3 and Xdebug v2.1.4.

Only tested there (before I found this bug) because I was seeing errors on my laptop (Debian/Ubuntu) which has the php package from 5.3.16-1~dotdeb.0 and XDebug v2.2.1.

Checking xdebug settings shows only a few differences, but those may be version things.

Debian squeeze worked.

$ php -v
PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug 6 2012 14:18:06)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

Trying to upgrade to Xdebug 2.2.

Recompiled XDebug from source and got the problem:

$ php -v
PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug 6 2012 14:18:06)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

with Xdebug v2.3.0dev, Copyright (c) 2002-2012, by Derick Rethans
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

http://bugs.xdebug.org/view.php?id=863

Adding xdebug.overload_var_dump=0 to php.ini solves the problem.

To add some search terms: "Parser hook: basic arguments". The setting can also be changed by the CLI option "-d", so "php -d xdebug.overload_var_dump=0 ./tests/parserTests.php" will work.

Generally, it would be nice to port these tests to PHPUnit and use assertEquals() so that they don't depend on formatting and indentation.