Fixed bug #70678 (PHP7 returns true when false is expected)

Cherry-pick from master.
This commit is contained in:
Felipe Pena 2015-10-11 12:08:34 -03:00 committed by Nikita Popov
parent e3e92e96c1
commit 20a384dfa9
2 changed files with 4 additions and 1 deletions

3
NEWS
View File

@ -10,6 +10,9 @@ PHP NEWS
. Fixed bug #70715 (Segmentation fault inside soap client). (Laruence)
. Fixed bug #70709 (SOAP Client generates Segfault). (Laruence)
- XSL:
. Fixed bug #70678 (PHP7 returns true when false is expected). (Felipe)
15 Oct 2015, PHP 7.0.0 RC 5
- Core:

View File

@ -351,7 +351,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
nodep = dom_object_get_node(obj);
valuePush(ctxt, xmlXPathNewNodeSet(nodep));
} else if (Z_TYPE(retval) == IS_TRUE || Z_TYPE(retval) == IS_FALSE) {
valuePush(ctxt, xmlXPathNewBoolean(Z_LVAL(retval)));
valuePush(ctxt, xmlXPathNewBoolean(Z_TYPE(retval) == IS_TRUE));
} else if (Z_TYPE(retval) == IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
valuePush(ctxt, xmlXPathNewString((const xmlChar *) ""));