Merge branch 'PHP-7.0'

* PHP-7.0:
  fix #69537: __debugInfo with empty string for key gives error
This commit is contained in:
Joe Watkins 2016-04-03 12:38:53 +01:00
commit bff13d90a8
2 changed files with 20 additions and 1 deletions

19
Zend/tests/bug69537.phpt Normal file
View file

@ -0,0 +1,19 @@
--TEST--
Bug #69537 (__debugInfo with empty string for key gives error)
--FILE--
<?php
class Foo {
public function __debugInfo(){
return ['' => 1];
}
}
var_dump(new Foo);
?>
--EXPECTF--
object(Foo)#%d (%d) {
[""]=>
int(1)
}

View file

@ -1314,7 +1314,7 @@ ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char
*class_name = NULL; *class_name = NULL;
if (ZSTR_VAL(name)[0] != '\0') { if (!ZSTR_LEN(name) || ZSTR_VAL(name)[0] != '\0') {
*prop_name = ZSTR_VAL(name); *prop_name = ZSTR_VAL(name);
if (prop_len) { if (prop_len) {
*prop_len = ZSTR_LEN(name); *prop_len = ZSTR_LEN(name);