Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug #800: var_dump(get_class(new foo\bar')) add an extra "\" in…

… class name.
  • Loading branch information...
commit f026d624f1d5a0b26b2736637becb54b567d609d 1 parent 591f593
@derickr authored
Showing with 19 additions and 1 deletion.
  1. +18 −0 tests/bug00800.phpt
  2. +1 −1  xdebug_var.c
View
18 tests/bug00800.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Test for bug #800: var_dump(get_class(new foo\bar')) add an extra "\" in class name.
+--SKIPIF--
+<?php if (!version_compare(phpversion(), "5.3", '>=')) echo "skip >= PHP 5.3 needed\n"; ?>
+--INI--
+xdebug.default_enable=1
+xdebug.overload_var_dump=1
+--FILE--
+<?php
+
+namespace foo;
+
+class bar {}
+
+var_dump(get_class(new bar));
+?>
+--EXPECT--
+string(7) "foo\bar"
View
2  xdebug_var.c
@@ -704,7 +704,7 @@ void xdebug_var_export_text_ansi(zval **struc, xdebug_str *str, int mode, int le
break;
case IS_STRING:
- tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "\\\0..\37", 6 TSRMLS_CC);
+ tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "\0..\37", 5 TSRMLS_CC);
if (options->no_decoration) {
xdebug_str_add(str, tmp_str, 0);
} else if (Z_STRLEN_PP(struc) <= options->max_data) {
Please sign in to comment.
Something went wrong with that request. Please try again.