}\n"; $html1 = '
Before
After
'; $dom3 = DomWrapper::fromString($html3); echo "Parsed as: " . $dom3->document->saveHTML() . "\n\n"; // Test 4: Check if elements are actually siblings echo "Test 4: Check element relationships\n"; $body = $dom3->document->body; if ($body) { echo "Body children count: " . $body->childNodes->length . "\n"; foreach ($body->childNodes as $i => $child) { if ($child instanceof \Dom\Element) { echo " Child #{$i}: {$child->tagName}\n"; } } }