Skip to content

Conversation

@ndossche
Copy link
Member

@ndossche ndossche commented Aug 7, 2023

No description provided.

@ndossche
Copy link
Member Author

ndossche commented Aug 7, 2023

omg, there's still an issue here even after this fix 😞
We also have to update the last pointer of the parent if there are no children.
We should just use dom_pre_insert here and be done with it, that function will take care of this mess. And if we're lucky, the compiler can optimize away some redundant checks by inlining.

@ndossche
Copy link
Member Author

ndossche commented Aug 7, 2023

Pushed the change, I'll check and test out append() tomorrow

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trusting that the output is correct, even if I cannot make out the different echos.

The actual code change is very intuitive and straight forward.

Comment on lines +18 to +25
$test = $doc->createElement('foo');
$test->append($child);
echo $doc->saveXML();
echo $doc->saveXML($test), "\n";
$test->prepend($child);
echo $doc->saveXML();
echo $doc->saveXML($test), "\n";
$test->append($child);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't make out where the output of one echo ends and where another echo starts.

Maybe add some ``echo "----------\n";` to make it more obvious?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ndossche ndossche closed this in d19e4da Aug 8, 2023
jorgsowa pushed a commit to jorgsowa/php-src that referenced this pull request Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants