Skip to content
Browse files

Merge branch 'xdebug_2_2'

  • Loading branch information...
2 parents 17bbf19 + f026d62 commit ff94e4b56a148f8da9337183f405bd127f0a3ba1 @derickr committed Jun 27, 2012
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) {

0 comments on commit ff94e4b

Please sign in to comment.
Something went wrong with that request. Please try again.