Permalink
Browse files

Merged pull request #390

  • Loading branch information...
derickr committed Dec 12, 2017
2 parents f527f7b + 9b69aea commit 4519199c05692bd8ac6f58f9ca665604d19e7c6b
@@ -0,0 +1,37 @@
--TEST--
Test for bug #1501: Xdebug var dump tries casting properties (text)
--SKIPIF--
<?php if (PHP_INT_SIZE != 4) { echo "skip Only for 32bit platforms"; } ?>
--INI--
html_errors=0
xdebug.cli_color=0
xdebug.default_enable=1
xdebug.overload_var_dump=2
--FILE--
<?php
class h extends stdClass {
public $data = array();
function __set($name, $val) {
$this->data[$name] = $val;
}
function __debugInfo() {
return $this->data;
}
}
$cl = new h();
$id = "373556941768884244";
$cl->$id = 'hallo';
var_dump($cl);
?>
--EXPECTF--
%sbug01501-001-32bit.php:20:
class h#%d (%d) {
public $373556941768884244 =>
string(5) "hallo"
}
@@ -0,0 +1,37 @@
--TEST--
Test for bug #1501: Xdebug var dump tries casting properties (text)
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) { echo "skip Only for 64bit platforms"; } ?>
--INI--
html_errors=0
xdebug.cli_color=0
xdebug.default_enable=1
xdebug.overload_var_dump=2
--FILE--
<?php
class h extends stdClass {
public $data = array();
function __set($name, $val) {
$this->data[$name] = $val;
}
function __debugInfo() {
return $this->data;
}
}
$cl = new h();
$id = "373556941768884244";
$cl->$id = 'hallo';
var_dump($cl);
?>
--EXPECTF--
%sbug01501-001-64bit.php:20:
class h#%d (%d) {
public ${373556941768884244} =>
string(5) "hallo"
}
@@ -0,0 +1,37 @@
--TEST--
Test for bug #1501: Xdebug var dump tries casting properties (HTML)
--SKIPIF--
<?php if (PHP_INT_SIZE != 4) { echo "skip Only for 32bit platforms"; } ?>
--INI--
html_errors=1
xdebug.cli_color=0
xdebug.default_enable=1
xdebug.overload_var_dump=2
--FILE--
<?php
class h extends stdClass {
public $data = array();
function __set($name, $val) {
$this->data[$name] = $val;
}
function __debugInfo() {
return $this->data;
}
}
$cl = new h();
$id = "373556941768884244";
$cl->$id = 'hallo';
var_dump($cl);
?>
--EXPECTF--
<pre class='xdebug-var-dump' dir='ltr'>
<small>%sbug01501-002-32bit.php:20:</small>
<b>object</b>(<i>h</i>)[<i>%d</i>]
<i>public</i> '373556941768884244' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'hallo'</font> <i>(length=5)</i>
</pre>
@@ -0,0 +1,37 @@
--TEST--
Test for bug #1501: Xdebug var dump tries casting properties (HTML)
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) { echo "skip Only for 64bit platforms"; } ?>
--INI--
html_errors=1
xdebug.cli_color=0
xdebug.default_enable=1
xdebug.overload_var_dump=2
--FILE--
<?php
class h extends stdClass {
public $data = array();
function __set($name, $val) {
$this->data[$name] = $val;
}
function __debugInfo() {
return $this->data;
}
}
$cl = new h();
$id = "373556941768884244";
$cl->$id = 'hallo';
var_dump($cl);
?>
--EXPECTF--
<pre class='xdebug-var-dump' dir='ltr'>
<small>%sbug01501-002-64bit.php:20:</small>
<b>object</b>(<i>h</i>)[<i>%d</i>]
<i>public</i> 373556941768884244 <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'hallo'</font> <i>(length=5)</i>
</pre>
@@ -0,0 +1,37 @@
--TEST--
Test for bug #1501: Xdebug var dump tries casting properties (ANSI)
--SKIPIF--
<?php if (PHP_INT_SIZE != 4) { echo "skip Only for 32bit platforms"; } ?>
--INI--
html_errors=0
xdebug.cli_color=2
xdebug.default_enable=1
xdebug.overload_var_dump=2
--FILE--
<?php
class h extends stdClass {
public $data = array();
function __set($name, $val) {
$this->data[$name] = $val;
}
function __debugInfo() {
return $this->data;
}
}
$cl = new h();
$id = "373556941768884244";
$cl->$id = 'hallo';
var_dump($cl);
?>
--EXPECTF--
%sbug01501-003-32bit.php:20:
class h#%d (%d) {
public $373556941768884244 =>
string(5) "hallo"
}
@@ -0,0 +1,37 @@
--TEST--
Test for bug #1501: Xdebug var dump tries casting properties (ANSI)
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) { echo "skip Only for 64bit platforms"; } ?>
--INI--
html_errors=0
xdebug.cli_color=2
xdebug.default_enable=1
xdebug.overload_var_dump=2
--FILE--
<?php
class h extends stdClass {
public $data = array();
function __set($name, $val) {
$this->data[$name] = $val;
}
function __debugInfo() {
return $this->data;
}
}
$cl = new h();
$id = "373556941768884244";
$cl->$id = 'hallo';
var_dump($cl);
?>
--EXPECTF--
%sbug01501-003-64bit.php:20:
class h#%d (%d) {
public ${373556941768884244} =>
string(5) "hallo"
}
View
@@ -593,7 +593,7 @@ void xdebug_init_debugger(TSRMLS_D)
} else if (XG(context).socket == -1) {
XDEBUG_LOG_PRINT(XG(remote_log_file), "E: Could not connect to client. :-(\n");
} else if (XG(context).socket == -2) {
XDEBUG_LOG_PRINT(XG(remote_log_file), "E: Time-out connecting to client (Waited: %ld ms). :-(\n", XG(remote_connect_timeout));
XDEBUG_LOG_PRINT(XG(remote_log_file), "E: Time-out connecting to client (Waited: " ZEND_LONG_FMT " ms). :-(\n", XG(remote_connect_timeout));
} else if (XG(context).socket == -3) {
XDEBUG_LOG_PRINT(XG(remote_log_file), "E: No permission connecting to client. This could be SELinux related. :-(\n");
}
View
@@ -1211,7 +1211,7 @@ static int xdebug_object_element_export_text_ansi(zval *zv_nptr, zend_ulong inde
xdfree(prop_name);
xdfree(class_name);
} else {
xdebug_str_add(str, xdebug_sprintf("%s%spublic%s%s ${%d} %s=>%s\n",
xdebug_str_add(str, xdebug_sprintf("%s%spublic%s%s ${" XDEBUG_INT_FMT "} %s=>%s\n",
ANSI_COLOR_MODIFIER, ANSI_COLOR_BOLD, ANSI_COLOR_BOLD_OFF, ANSI_COLOR_RESET,
index_key, ANSI_COLOR_POINTER, ANSI_COLOR_RESET), 1);
}
@@ -2128,7 +2128,7 @@ static int xdebug_object_element_export_fancy(zval *zv_nptr, zend_ulong index_ke
xdfree(prop_name);
xdfree(prop_class_name);
} else {
xdebug_str_add(str, xdebug_sprintf("<i>public</i> %d <font color='%s'>=&gt;</font> ", index_key, COLOR_POINTER), 1);
xdebug_str_add(str, xdebug_sprintf("<i>public</i> " XDEBUG_INT_FMT " <font color='%s'>=&gt;</font> ", index_key, COLOR_POINTER), 1);
}
xdebug_var_export_fancy(zv, str, level + 1, debug_zval, options TSRMLS_CC);
}

0 comments on commit 4519199

Please sign in to comment.