Revert "simplexml fixes for text children and casting"

Esse commit está contido em:
Sean Cannella
2013-07-24 17:53:53 -07:00
commit de Sara Golemon
commit 4eb23b6687
5 arquivos alterados com 2 adições e 21 exclusões
+2 -6
Ver Arquivo
@@ -524,9 +524,7 @@ Object c_SimpleXMLElement::t_children(CStrRef ns /* = "" */,
elem->m_is_text = m_is_text;
elem->m_free_text = m_free_text;
elem->m_is_children = true;
if (m_is_text) {
// text nodes don't have children
} else if (ns.empty()) {
if (ns.empty()) {
elem->m_children.assignRef(m_children);
} else {
Array props = Array::Create();
@@ -875,9 +873,7 @@ Variant c_SimpleXMLElement::t___set(Variant name, Variant value) {
}
bool c_SimpleXMLElement::o_toBooleanImpl() const noexcept {
return (m_node || getDynProps().size()) &&
(m_node->parent->type != XML_DOCUMENT_NODE ||
m_children.toArray().size());
return (m_node || getDynProps().size());
}
int64_t c_SimpleXMLElement::o_toInt64Impl() const noexcept {
-7
Ver Arquivo
@@ -1,7 +0,0 @@
<?php
$element = new SimpleXMLElement('<root />');
var_dump((bool)$element);
$element = new SimpleXMLElement('<root><child /></root>');
var_dump((bool)$element->child);
@@ -1,2 +0,0 @@
bool(false)
bool(true)
@@ -1,4 +0,0 @@
<?php
$element = simplexml_load_string('<root><hello>world</hello></root>');
var_dump($element->hello->children());
@@ -1,2 +0,0 @@
object(SimpleXMLElement)#4 (0) {
}