summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-03-04 10:53:47 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-06-24 15:09:21 +0200
commit4730b06f1d026047c63980298d358e28e2183de6 (patch)
tree33448c7a0cfd955e77b1ae423391b2ee1efa0d2d
parentbcb9658b87b954fb3f910d337d9abf83b74b21f3 (diff)
downloadphp-git-4730b06f1d026047c63980298d358e28e2183de6.tar.gz
Make SimpleXMLElement a RecursiveIterator
Context: https://externals.io/message/108789 This essentially moves the functionality of SimpleXMLIterator into SimpleXMLElement, and makes SimpleXMLIterator a no-op extension. Ideally SimpleXMLElement would be an IteratorAggregate, whose getIterator() method returns SimpleXMLIterator. However, because SimpleXMLIterator extends SimpleXMLElement (and code depends on this in non-trivial ways), this is not possible. The only way to not keep SimpleXMLElement as a magic Traversable (that implements neither Iterator nor IteratorAggregate) is to move the SimpleXMLIterator functionality into it. Closes GH-5234.
-rw-r--r--UPGRADING5
-rw-r--r--ext/shmop/shmop_arginfo.h2
-rw-r--r--ext/simplexml/config.m42
-rw-r--r--ext/simplexml/config.w322
-rw-r--r--ext/simplexml/php_simplexml.h3
-rw-r--r--ext/simplexml/simplexml.c155
-rw-r--r--ext/simplexml/simplexml.stub.php27
-rw-r--r--ext/simplexml/simplexml_arginfo.h35
-rw-r--r--ext/simplexml/sxe.c190
-rw-r--r--ext/simplexml/sxe.h27
-rw-r--r--ext/simplexml/sxe.stub.php27
-rw-r--r--ext/simplexml/sxe_arginfo.h38
12 files changed, 218 insertions, 295 deletions
diff --git a/UPGRADING b/UPGRADING
index f2210ee055..744fead12a 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -793,6 +793,11 @@ PHP 8.0 UPGRADE NOTES
- PGSQL / PDO PGSQL:
. The PGSQL and PDO PGSQL extensions now require at least libpq 9.1.
+- SimpleXML:
+ . SimpleXMLElement now implements RecursiveIterator and absorbed the
+ functionality of SimpleXMLIterator. SimpleXMLIterator is an empty extension
+ of SimpleXMLElement.
+
- Shmop:
. shmop_open() will now return a Shmop object rather than a resource. Return
value checks using is_resource() should be replaced with checks for `false`.
diff --git a/ext/shmop/shmop_arginfo.h b/ext/shmop/shmop_arginfo.h
index 55914efb8c..494559e4f5 100644
--- a/ext/shmop/shmop_arginfo.h
+++ b/ext/shmop/shmop_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a2e7d50e79d253e7136a54222346341003cc3b04 */
+ * Stub hash: e451ccfbe66fc2b6fc0dae6e7e5710ededaf7b0c */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_shmop_open, 0, 4, Shmop, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0)
diff --git a/ext/simplexml/config.m4 b/ext/simplexml/config.m4
index 1acd1898c1..8b8a6f814a 100644
--- a/ext/simplexml/config.m4
+++ b/ext/simplexml/config.m4
@@ -12,7 +12,7 @@ if test "$PHP_SIMPLEXML" != "no"; then
PHP_SETUP_LIBXML(SIMPLEXML_SHARED_LIBADD, [
AC_DEFINE(HAVE_SIMPLEXML,1,[ ])
- PHP_NEW_EXTENSION(simplexml, simplexml.c sxe.c, $ext_shared)
+ PHP_NEW_EXTENSION(simplexml, simplexml.c, $ext_shared)
PHP_INSTALL_HEADERS([ext/simplexml/php_simplexml.h ext/simplexml/php_simplexml_exports.h])
PHP_SUBST(SIMPLEXML_SHARED_LIBADD)
])
diff --git a/ext/simplexml/config.w32 b/ext/simplexml/config.w32
index a95be65738..a6011fedc2 100644
--- a/ext/simplexml/config.w32
+++ b/ext/simplexml/config.w32
@@ -7,7 +7,7 @@ if (PHP_SIMPLEXML == "yes") {
ADD_EXTENSION_DEP('simplexml', 'libxml') &&
CHECK_HEADER_ADD_INCLUDE("libxml/tree.h", "CFLAGS_SIMPLEXML", PHP_PHP_BUILD + "\\include\\libxml2")
) {
- EXTENSION("simplexml", "simplexml.c sxe.c");
+ EXTENSION("simplexml", "simplexml.c");
AC_DEFINE("HAVE_SIMPLEXML", 1, "Simple XML support");
if (!PHP_SIMPLEXML_SHARED) {
ADD_FLAG("CFLAGS_SIMPLEXML", "/D LIBXML_STATIC");
diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h
index 4620afad06..0a229df0c0 100644
--- a/ext/simplexml/php_simplexml.h
+++ b/ext/simplexml/php_simplexml.h
@@ -77,6 +77,9 @@ typedef struct {
# define PHP_SXE_API ZEND_API
#endif
+extern PHP_SXE_API zend_class_entry *ce_SimpleXMLIterator;
+extern PHP_SXE_API zend_class_entry *ce_SimpleXMLElement;
+
PHP_SXE_API zend_class_entry *sxe_get_element_class_entry(void);
#endif
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 8d8a47f73e..d392867575 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -31,9 +31,11 @@
#include "simplexml_arginfo.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
-#include "sxe.h"
+#include "ext/spl/spl_iterators.h"
zend_class_entry *sxe_class_entry = NULL;
+PHP_SXE_API zend_class_entry *ce_SimpleXMLIterator;
+PHP_SXE_API zend_class_entry *ce_SimpleXMLElement;
PHP_SXE_API zend_class_entry *sxe_get_element_class_entry(void) /* {{{ */
{
@@ -2024,6 +2026,138 @@ SXE_METHOD(count)
}
/* }}} */
+
+/* {{{ proto void SimpleXMLElement::rewind()
+ Rewind to first element */
+SXE_METHOD(rewind)
+{
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ php_sxe_rewind_iterator(Z_SXEOBJ_P(ZEND_THIS));
+}
+/* }}} */
+
+/* {{{ proto bool SimpleXMLElement::valid()
+ Check whether iteration is valid */
+SXE_METHOD(valid)
+{
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ RETURN_BOOL(!Z_ISUNDEF(sxe->iter.data));
+}
+/* }}} */
+
+/* {{{ proto SimpleXMLElement SimpleXMLElement::current()
+ Get current element */
+SXE_METHOD(current)
+{
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
+ zval *data;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ if (Z_ISUNDEF(sxe->iter.data)) {
+ return; /* return NULL */
+ }
+
+ data = &sxe->iter.data;
+ ZVAL_COPY_DEREF(return_value, data);
+}
+/* }}} */
+
+/* {{{ proto string SimpleXMLElement::key()
+ Get name of current child element */
+SXE_METHOD(key)
+{
+ xmlNodePtr curnode;
+ php_sxe_object *intern;
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ if (Z_ISUNDEF(sxe->iter.data)) {
+ RETURN_FALSE;
+ }
+
+ intern = Z_SXEOBJ_P(&sxe->iter.data);
+ if (intern != NULL && intern->node != NULL) {
+ curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node;
+ RETURN_STRINGL((char*)curnode->name, xmlStrlen(curnode->name));
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto void SimpleXMLElement::next()
+ Move to next element */
+SXE_METHOD(next)
+{
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ php_sxe_move_forward_iterator(Z_SXEOBJ_P(ZEND_THIS));
+}
+/* }}} */
+
+/* {{{ proto bool SimpleXMLElement::hasChildren()
+ Check whether element has children (elements) */
+SXE_METHOD(hasChildren)
+{
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
+ php_sxe_object *child;
+ xmlNodePtr node;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ if (Z_ISUNDEF(sxe->iter.data) || sxe->iter.type == SXE_ITER_ATTRLIST) {
+ RETURN_FALSE;
+ }
+ child = Z_SXEOBJ_P(&sxe->iter.data);
+
+ GET_NODE(child, node);
+ if (node) {
+ node = node->children;
+ }
+ while (node && node->type != XML_ELEMENT_NODE) {
+ node = node->next;
+ }
+ RETURN_BOOL(node ? 1 : 0);
+}
+/* }}} */
+
+/* {{{ proto SimpleXMLElement SimpleXMLElement::getChildren()
+ Get child element iterator */
+SXE_METHOD(getChildren)
+{
+ php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
+ zval *data;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ if (Z_ISUNDEF(sxe->iter.data) || sxe->iter.type == SXE_ITER_ATTRLIST) {
+ return; /* return NULL */
+ }
+
+ data = &sxe->iter.data;
+ ZVAL_COPY_DEREF(return_value, data);
+}
+
static zend_object_handlers sxe_object_handlers;
/* {{{ sxe_object_clone()
@@ -2617,13 +2751,14 @@ ZEND_GET_MODULE(simplexml)
*/
PHP_MINIT_FUNCTION(simplexml)
{
- zend_class_entry sxe;
+ zend_class_entry ce;
- INIT_CLASS_ENTRY(sxe, "SimpleXMLElement", class_SimpleXMLElement_methods);
- sxe.create_object = sxe_object_new;
- sxe_class_entry = zend_register_internal_class(&sxe);
+ INIT_CLASS_ENTRY(ce, "SimpleXMLElement", class_SimpleXMLElement_methods);
+ sxe_class_entry = zend_register_internal_class(&ce);
+ sxe_class_entry->create_object = sxe_object_new;
sxe_class_entry->get_iterator = php_sxe_get_iterator;
- zend_class_implements(sxe_class_entry, 3, zend_ce_traversable, zend_ce_countable, zend_ce_stringable);
+ zend_class_implements(sxe_class_entry, 3,
+ zend_ce_countable, zend_ce_stringable, spl_ce_RecursiveIterator);
memcpy(&sxe_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
sxe_object_handlers.offset = XtOffsetOf(php_sxe_object, zo);
@@ -2650,9 +2785,13 @@ PHP_MINIT_FUNCTION(simplexml)
sxe_class_entry->serialize = zend_class_serialize_deny;
sxe_class_entry->unserialize = zend_class_unserialize_deny;
- php_libxml_register_export(sxe_class_entry, simplexml_export_node);
+ /* TODO: Why do we have two variables for this? */
+ ce_SimpleXMLElement = sxe_class_entry;
- PHP_MINIT(sxe)(INIT_FUNC_ARGS_PASSTHRU);
+ INIT_CLASS_ENTRY(ce, "SimpleXMLIterator", NULL);
+ ce_SimpleXMLIterator = zend_register_internal_class_ex(&ce, ce_SimpleXMLElement);
+
+ php_libxml_register_export(sxe_class_entry, simplexml_export_node);
return SUCCESS;
}
diff --git a/ext/simplexml/simplexml.stub.php b/ext/simplexml/simplexml.stub.php
index 68eaf2be6e..2922adce4b 100644
--- a/ext/simplexml/simplexml.stub.php
+++ b/ext/simplexml/simplexml.stub.php
@@ -8,7 +8,7 @@ function simplexml_load_string(string $data, ?string $class_name = SimpleXMLElem
function simplexml_import_dom(DOMNode $node, ?string $class_name = SimpleXMLElement::class): ?SimpleXMLElement {}
-class SimpleXMLElement implements Stringable
+class SimpleXMLElement implements Stringable, Countable, RecursiveIterator
{
/** @return array|false */
public function xpath(string $path) {}
@@ -52,4 +52,29 @@ class SimpleXMLElement implements Stringable
/** @return int */
public function count() {}
+
+ /** @return void */
+ public function rewind() {}
+
+ /** @return bool */
+ public function valid() {}
+
+ /** @return ?SimpleXMLElement */
+ public function current() {}
+
+ /** @return string|false */
+ public function key() {}
+
+ /** @return void */
+ public function next() {}
+
+ /** @return bool */
+ public function hasChildren() {}
+
+ /** @return ?SimpleXMLElement */
+ public function getChildren() {}
+}
+
+class SimpleXMLIterator extends SimpleXMLElement
+{
}
diff --git a/ext/simplexml/simplexml_arginfo.h b/ext/simplexml/simplexml_arginfo.h
index 6e34145956..964c5c3c6a 100644
--- a/ext/simplexml/simplexml_arginfo.h
+++ b/ext/simplexml/simplexml_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: f74d2fc54ca25216f1b54b0776c480d5e8d297fb */
+ * Stub hash: 7b3ff8b991fc7e424aaf1e86cfbebe662a30c48f */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_simplexml_load_file, 0, 1, SimpleXMLElement, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -77,6 +77,20 @@ ZEND_END_ARG_INFO()
#define arginfo_class_SimpleXMLElement_count arginfo_class_SimpleXMLElement_getName
+#define arginfo_class_SimpleXMLElement_rewind arginfo_class_SimpleXMLElement_getName
+
+#define arginfo_class_SimpleXMLElement_valid arginfo_class_SimpleXMLElement_getName
+
+#define arginfo_class_SimpleXMLElement_current arginfo_class_SimpleXMLElement_getName
+
+#define arginfo_class_SimpleXMLElement_key arginfo_class_SimpleXMLElement_getName
+
+#define arginfo_class_SimpleXMLElement_next arginfo_class_SimpleXMLElement_getName
+
+#define arginfo_class_SimpleXMLElement_hasChildren arginfo_class_SimpleXMLElement_getName
+
+#define arginfo_class_SimpleXMLElement_getChildren arginfo_class_SimpleXMLElement_getName
+
ZEND_FUNCTION(simplexml_load_file);
ZEND_FUNCTION(simplexml_load_string);
@@ -94,6 +108,13 @@ ZEND_METHOD(SimpleXMLElement, addAttribute);
ZEND_METHOD(SimpleXMLElement, getName);
ZEND_METHOD(SimpleXMLElement, __toString);
ZEND_METHOD(SimpleXMLElement, count);
+ZEND_METHOD(SimpleXMLElement, rewind);
+ZEND_METHOD(SimpleXMLElement, valid);
+ZEND_METHOD(SimpleXMLElement, current);
+ZEND_METHOD(SimpleXMLElement, key);
+ZEND_METHOD(SimpleXMLElement, next);
+ZEND_METHOD(SimpleXMLElement, hasChildren);
+ZEND_METHOD(SimpleXMLElement, getChildren);
static const zend_function_entry ext_functions[] = {
@@ -119,5 +140,17 @@ static const zend_function_entry class_SimpleXMLElement_methods[] = {
ZEND_ME(SimpleXMLElement, getName, arginfo_class_SimpleXMLElement_getName, ZEND_ACC_PUBLIC)
ZEND_ME(SimpleXMLElement, __toString, arginfo_class_SimpleXMLElement___toString, ZEND_ACC_PUBLIC)
ZEND_ME(SimpleXMLElement, count, arginfo_class_SimpleXMLElement_count, ZEND_ACC_PUBLIC)
+ ZEND_ME(SimpleXMLElement, rewind, arginfo_class_SimpleXMLElement_rewind, ZEND_ACC_PUBLIC)
+ ZEND_ME(SimpleXMLElement, valid, arginfo_class_SimpleXMLElement_valid, ZEND_ACC_PUBLIC)
+ ZEND_ME(SimpleXMLElement, current, arginfo_class_SimpleXMLElement_current, ZEND_ACC_PUBLIC)
+ ZEND_ME(SimpleXMLElement, key, arginfo_class_SimpleXMLElement_key, ZEND_ACC_PUBLIC)
+ ZEND_ME(SimpleXMLElement, next, arginfo_class_SimpleXMLElement_next, ZEND_ACC_PUBLIC)
+ ZEND_ME(SimpleXMLElement, hasChildren, arginfo_class_SimpleXMLElement_hasChildren, ZEND_ACC_PUBLIC)
+ ZEND_ME(SimpleXMLElement, getChildren, arginfo_class_SimpleXMLElement_getChildren, ZEND_ACC_PUBLIC)
+ ZEND_FE_END
+};
+
+
+static const zend_function_entry class_SimpleXMLIterator_methods[] = {
ZEND_FE_END
};
diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c
deleted file mode 100644
index 66ff567249..0000000000
--- a/ext/simplexml/sxe.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | Copyright (c) The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Marcus Boerger <helly@php.net> |
- +----------------------------------------------------------------------+
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "zend_interfaces.h"
-
-#include "php_simplexml.h"
-#include "ext/spl/php_spl.h"
-#include "ext/spl/spl_iterators.h"
-#include "sxe.h"
-#include "sxe_arginfo.h"
-
-PHP_SXE_API zend_class_entry *ce_SimpleXMLIterator = NULL;
-PHP_SXE_API zend_class_entry *ce_SimpleXMLElement;
-
-#include "php_simplexml_exports.h"
-
-/* {{{ proto void SimpleXMLIterator::rewind()
- Rewind to first element */
-PHP_METHOD(SimpleXMLIterator, rewind)
-{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
-
- php_sxe_rewind_iterator(Z_SXEOBJ_P(ZEND_THIS));
-}
-/* }}} */
-
-/* {{{ proto bool SimpleXMLIterator::valid()
- Check whether iteration is valid */
-PHP_METHOD(SimpleXMLIterator, valid)
-{
- php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
-
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
-
- RETURN_BOOL(!Z_ISUNDEF(sxe->iter.data));
-}
-/* }}} */
-
-/* {{{ proto SimpleXMLIterator SimpleXMLIterator::current()
- Get current element */
-PHP_METHOD(SimpleXMLIterator, current)
-{
- php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
- zval *data;
-
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
-
- if (Z_ISUNDEF(sxe->iter.data)) {
- return; /* return NULL */
- }
-
- data = &sxe->iter.data;
- ZVAL_COPY_DEREF(return_value, data);
-}
-/* }}} */
-
-/* {{{ proto string SimpleXMLIterator::key()
- Get name of current child element */
-PHP_METHOD(SimpleXMLIterator, key)
-{
- xmlNodePtr curnode;
- php_sxe_object *intern;
- php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
-
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
-
- if (Z_ISUNDEF(sxe->iter.data)) {
- RETURN_FALSE;
- }
-
- intern = Z_SXEOBJ_P(&sxe->iter.data);
- if (intern != NULL && intern->node != NULL) {
- curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node;
- RETURN_STRINGL((char*)curnode->name, xmlStrlen(curnode->name));
- }
-
- RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ proto void SimpleXMLIterator::next()
- Move to next element */
-PHP_METHOD(SimpleXMLIterator, next)
-{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
-
- php_sxe_move_forward_iterator(Z_SXEOBJ_P(ZEND_THIS));
-}
-/* }}} */
-
-/* {{{ proto bool SimpleXMLIterator::hasChildren()
- Check whether element has children (elements) */
-PHP_METHOD(SimpleXMLIterator, hasChildren)
-{
- php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
- php_sxe_object *child;
- xmlNodePtr node;
-
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
-
- if (Z_ISUNDEF(sxe->iter.data) || sxe->iter.type == SXE_ITER_ATTRLIST) {
- RETURN_FALSE;
- }
- child = Z_SXEOBJ_P(&sxe->iter.data);
-
- GET_NODE(child, node);
- if (node) {
- node = node->children;
- }
- while (node && node->type != XML_ELEMENT_NODE) {
- node = node->next;
- }
- RETURN_BOOL(node ? 1 : 0);
-}
-/* }}} */
-
-/* {{{ proto SimpleXMLIterator SimpleXMLIterator::getChildren()
- Get child element iterator */
-PHP_METHOD(SimpleXMLIterator, getChildren)
-{
- php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
- zval *data;
-
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
-
- if (Z_ISUNDEF(sxe->iter.data) || sxe->iter.type == SXE_ITER_ATTRLIST) {
- return; /* return NULL */
- }
-
- data = &sxe->iter.data;
- ZVAL_COPY_DEREF(return_value, data);
-}
-
-PHP_MINIT_FUNCTION(sxe) /* {{{ */
-{
- zend_class_entry *pce;
- zend_class_entry sxi;
-
- if ((pce = zend_hash_str_find_ptr(CG(class_table), "simplexmlelement", sizeof("SimpleXMLElement") - 1)) == NULL) {
- ce_SimpleXMLElement = NULL;
- ce_SimpleXMLIterator = NULL;
- return SUCCESS; /* SimpleXML must be initialized before */
- }
-
- ce_SimpleXMLElement = pce;
-
- INIT_CLASS_ENTRY_EX(sxi, "SimpleXMLIterator", sizeof("SimpleXMLIterator") - 1, class_SimpleXMLIterator_methods);
- ce_SimpleXMLIterator = zend_register_internal_class_ex(&sxi, ce_SimpleXMLElement);
- ce_SimpleXMLIterator->create_object = ce_SimpleXMLElement->create_object;
-
- zend_class_implements(ce_SimpleXMLIterator, 1, spl_ce_RecursiveIterator);
- zend_class_implements(ce_SimpleXMLIterator, 1, zend_ce_countable);
-
- return SUCCESS;
-}
-/* }}} */
diff --git a/ext/simplexml/sxe.h b/ext/simplexml/sxe.h
deleted file mode 100644
index 771ddea4bb..0000000000
--- a/ext/simplexml/sxe.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | Copyright (c) The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Marcus Boerger <helly@php.net> |
- +----------------------------------------------------------------------+
- */
-
-#ifndef SXE_H
-#define SXE_H
-
-#include "php.h"
-
-extern PHP_SXE_API zend_class_entry *ce_SimpleXMLIterator;
-extern PHP_SXE_API zend_class_entry *ce_SimpleXMLElement;
-
-PHP_MINIT_FUNCTION(sxe);
-
-#endif /* SXE_H */
diff --git a/ext/simplexml/sxe.stub.php b/ext/simplexml/sxe.stub.php
deleted file mode 100644
index a6e24dbc5c..0000000000
--- a/ext/simplexml/sxe.stub.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/** @generate-function-entries */
-
-class SimpleXMLIterator
-{
- /** @return void */
- public function rewind() {}
-
- /** @return bool */
- public function valid() {}
-
- /** @return SimpleXMLElement|null */
- public function current() {}
-
- /** @return string|false */
- public function key() {}
-
- /** @return void */
- public function next() {}
-
- /** @return bool */
- public function hasChildren() {}
-
- /** @return SimpleXMLIterator|null */
- public function getChildren() {}
-}
diff --git a/ext/simplexml/sxe_arginfo.h b/ext/simplexml/sxe_arginfo.h
deleted file mode 100644
index 9c76e7dbf5..0000000000
--- a/ext/simplexml/sxe_arginfo.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 1ac1e57f7ec3e8a0340b74f0497e1eb9a2b7f663 */
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLIterator_rewind, 0, 0, 0)
-ZEND_END_ARG_INFO()
-
-#define arginfo_class_SimpleXMLIterator_valid arginfo_class_SimpleXMLIterator_rewind
-
-#define arginfo_class_SimpleXMLIterator_current arginfo_class_SimpleXMLIterator_rewind
-
-#define arginfo_class_SimpleXMLIterator_key arginfo_class_SimpleXMLIterator_rewind
-
-#define arginfo_class_SimpleXMLIterator_next arginfo_class_SimpleXMLIterator_rewind
-
-#define arginfo_class_SimpleXMLIterator_hasChildren arginfo_class_SimpleXMLIterator_rewind
-
-#define arginfo_class_SimpleXMLIterator_getChildren arginfo_class_SimpleXMLIterator_rewind
-
-
-ZEND_METHOD(SimpleXMLIterator, rewind);
-ZEND_METHOD(SimpleXMLIterator, valid);
-ZEND_METHOD(SimpleXMLIterator, current);
-ZEND_METHOD(SimpleXMLIterator, key);
-ZEND_METHOD(SimpleXMLIterator, next);
-ZEND_METHOD(SimpleXMLIterator, hasChildren);
-ZEND_METHOD(SimpleXMLIterator, getChildren);
-
-
-static const zend_function_entry class_SimpleXMLIterator_methods[] = {
- ZEND_ME(SimpleXMLIterator, rewind, arginfo_class_SimpleXMLIterator_rewind, ZEND_ACC_PUBLIC)
- ZEND_ME(SimpleXMLIterator, valid, arginfo_class_SimpleXMLIterator_valid, ZEND_ACC_PUBLIC)
- ZEND_ME(SimpleXMLIterator, current, arginfo_class_SimpleXMLIterator_current, ZEND_ACC_PUBLIC)
- ZEND_ME(SimpleXMLIterator, key, arginfo_class_SimpleXMLIterator_key, ZEND_ACC_PUBLIC)
- ZEND_ME(SimpleXMLIterator, next, arginfo_class_SimpleXMLIterator_next, ZEND_ACC_PUBLIC)
- ZEND_ME(SimpleXMLIterator, hasChildren, arginfo_class_SimpleXMLIterator_hasChildren, ZEND_ACC_PUBLIC)
- ZEND_ME(SimpleXMLIterator, getChildren, arginfo_class_SimpleXMLIterator_getChildren, ZEND_ACC_PUBLIC)
- ZEND_FE_END
-};