Compare commits

...
7 Commits
13 changed files with 45 additions and 164 deletions

No files matched your search

+1 -4
View File
@@ -1,6 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2017, PHP 7.1.2
16 Feb 2017, PHP 7.1.2
- Core:
. Improved GENERATOR_CREATE opcode handler. (Bob, Dmitry)
@@ -11,13 +11,10 @@ PHP NEWS
. Fixed bug #73969 (segfault in debug_print_backtrace). (andrewnester)
. Fixed bug #73994 (arginfo incorrect for unpack). (krakjoe)
. Fixed bug #73973 (assertion error in debug_zval_dump). (andrewnester)
. Fixed bug #73987 (Method compatibility check looks to original
definition and not parent). (pmmaga)
- DOM:
. Fixed bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes).
(aboks)
. Fixed bug #50989 (support for LIBXML_NOXMLDECL). (jhdxr)
- DTrace:
. Fixed bug #73965 (DTrace reported as enabled when disabled). (Remi)
+1 -1
View File
@@ -23,4 +23,4 @@ class B extends A {
}
?>
--EXPECTF--
Fatal error: Declaration of B::foo($var) must be compatible with A::foo() in %sbug62358.php on line 17
Fatal error: Declaration of B::foo($var) must be compatible with I::foo() in %sbug62358.php on line 17
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #73987 (Method compatibility check looks to original definition and not parent - nullability interface)
--FILE--
<?php
interface I {
public function example($a, $b, $c);
}
class A implements I {
public function example($a, $b = null, $c = null) { } // compatible with I::example
}
class B extends A {
public function example($a, $b, $c = null) { } // compatible with I::example
}
?>
--EXPECTF--
Fatal error: Declaration of B::example($a, $b, $c = NULL) must be compatible with A::example($a, $b = NULL, $c = NULL) in %s
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #73987 (Method compatibility check looks to original definition and not parent - return types interface)
--FILE--
<?php
interface I {
public function example();
}
class A implements I {
public function example(): int { } // compatible with I::example
}
class B extends A {
public function example(): string { } // compatible with I::example
}
?>
--EXPECTF--
Fatal error: Declaration of B::example(): string must be compatible with A::example(): int in %s
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #73987 (Method compatibility check looks to original definition and not parent - nullabilty abstract)
--FILE--
<?php
abstract class A {
abstract function example($a, $b, $c);
}
class B extends A {
function example($a, $b = null, $c = null) { }
}
class C extends B {
function example($a, $b, $c = null) { }
}
?>
--EXPECTF--
Fatal error: Declaration of C::example($a, $b, $c = NULL) must be compatible with B::example($a, $b = NULL, $c = NULL) in %s
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #73987 (Method compatibility check looks to original definition and not parent - return types abstract)
--FILE--
<?php
abstract class A {
abstract function example();
}
class B extends A {
function example(): int { }
}
class C extends B {
function example(): string { }
}
?>
--EXPECTF--
Fatal error: Declaration of C::example(): string must be compatible with B::example(): int in %s
+5 -4
View File
@@ -607,12 +607,13 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
} else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
/* ctors only have a prototype if it comes from an interface */
child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
/* and if that is the case, we want to check inheritance against it */
if (parent->common.fn_flags & ZEND_ACC_CTOR) {
parent = child->common.prototype;
}
}
if (child->common.prototype && (
child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT
)) {
parent = child->common.prototype;
}
if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) {
int error_level;
const char *error_verb;
+1 -1
View File
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=1
PHP_RELEASE_VERSION=2
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+33 -29
View File
@@ -26,7 +26,6 @@
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#include "php_dom.h"
#include <libxml/xmlsave.h>
#include <libxml/SAX.h>
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/relaxng.h>
@@ -1617,54 +1616,59 @@ PHP_FUNCTION(dom_document_savexml)
dom_doc_propsptr doc_props;
int size, format, saveempty = 0;
zend_long options = 0;
xmlSaveCtxtPtr xscp;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) {
return;
}
options = options | XML_SAVE_AS_XML;
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
doc_props = dom_get_doc_props(intern->document);
format = doc_props->formatoutput;
if (format) {
options = options | XML_SAVE_FORMAT;
}
buf = xmlBufferCreate();
if (!buf) {
php_error_docref(NULL, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
xscp = xmlSaveToBuffer(buf, docp->encoding, options);
if (nodep != NULL) {
/* Dump contents of Node */
DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj);
if (node->doc != docp) {
php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
buf = xmlBufferCreate();
if (!buf) {
php_error_docref(NULL, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
if (options & LIBXML_SAVE_NOEMPTYTAG) {
saveempty = xmlSaveNoEmptyTags;
xmlSaveNoEmptyTags = 1;
}
xmlNodeDump(buf, docp, node, 0, format);
if (options & LIBXML_SAVE_NOEMPTYTAG) {
xmlSaveNoEmptyTags = saveempty;
}
mem = (xmlChar*) xmlBufferContent(buf);
if (!mem) {
xmlBufferFree(buf);
RETURN_FALSE;
}
if(xmlSaveTree(xscp, node) < 0) {
xmlBufferFree(buf);
RETURN_FALSE;
}
} else {
if(xmlSaveDoc(xscp, docp) < 0) {
xmlBufferFree(buf);
RETURN_FALSE;
}
}
xmlSaveClose(xscp);
mem = (xmlChar*) xmlBufferContent(buf);
if (!mem) {
RETVAL_STRING((char *) mem);
xmlBufferFree(buf);
RETURN_FALSE;
} else {
if (options & LIBXML_SAVE_NOEMPTYTAG) {
saveempty = xmlSaveNoEmptyTags;
xmlSaveNoEmptyTags = 1;
}
/* Encoding is handled from the encoding property set on the document */
xmlDocDumpFormatMemory(docp, &mem, &size, format);
if (options & LIBXML_SAVE_NOEMPTYTAG) {
xmlSaveNoEmptyTags = saveempty;
}
if (!size || !mem) {
RETURN_FALSE;
}
RETVAL_STRINGL((char *) mem, size);
xmlFree(mem);
}
RETVAL_STRING((char *) mem);
xmlBufferFree(buf);
}
/* }}} end dom_document_savexml */
@@ -1,33 +0,0 @@
--TEST--
DOM Document: saveXML with createElement and formatOutput
--CREDITS--
CHU Zhaowei <jhdxr@php.net>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new domDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
$root = $dom->createElement('root');
$dom->appendChild($root);
$child1 = $dom->createElement('testsuite');
$root->appendChild($child1);
$child11 = $dom->createElement('testcase');
$child11->setAttribute('name', 'leaf1');
$child12 = $dom->createElement('testcase');
$child12->setAttribute('name', 'leaf2');
$child1->appendChild($child11);
$child1->appendChild($child12);
echo $dom->saveXml();
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<root>
<testsuite>
<testcase name="leaf1"/>
<testcase name="leaf2"/>
</testsuite>
</root>
-12
View File
@@ -1,12 +0,0 @@
--TEST--
Bug #50989 add support LIBXML_NOXMLDECL for DOMDocument::saveXML()
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new DomDocument();
$dom->loadXML("<foo />");
print $dom->saveXML(null,LIBXML_NOXMLDECL);
--EXPECT--
<foo/>
+2 -2
View File
@@ -14,5 +14,5 @@ $poc = 'O:8:"stdClass":1:{i:0;O:3:"obj":1:{s:4:"ryat";R:1;}}';
var_dump(unserialize($poc));
?>
--EXPECT--
int(73588229205)
--EXPECTF--
%s(73588229205)
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 1
#define PHP_RELEASE_VERSION 2
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.1.2-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.1.2"
#define PHP_VERSION_ID 70102