diff --git a/ext/dom/tests/DOMElement_toggleAttribute.phpt b/ext/dom/tests/DOMElement_toggleAttribute.phpt
index ed29be899da..b9e9989e1fe 100644
--- a/ext/dom/tests/DOMElement_toggleAttribute.phpt
+++ b/ext/dom/tests/DOMElement_toggleAttribute.phpt
@@ -87,7 +87,7 @@ echo "Checking toggled namespace:\n";
var_dump($dom->documentElement->getAttribute('xmlns:anotheron'));
?>
---EXPECT--
+--EXPECTF--
Invalid Character Error
--- Selected attribute tests (HTML) ---
bool(false)
@@ -95,10 +95,10 @@ bool(false)
bool(true)
-
+
bool(true)
-
+
bool(false)
diff --git a/ext/dom/tests/gh10234.phpt b/ext/dom/tests/gh10234.phpt
index 5edc8fc6c1f..11d39cd625a 100644
--- a/ext/dom/tests/gh10234.phpt
+++ b/ext/dom/tests/gh10234.phpt
@@ -55,7 +55,7 @@ $document->documentElement->textContent = "quote 'test'";
var_dump($document->documentElement->textContent);
var_dump($document->saveHTML());
?>
---EXPECT--
+--EXPECTF--
-- Attribute tests --
string(38) "
"
@@ -67,10 +67,10 @@ string(13) "hello & world"
string(50) "
"
string(9) "hi"
-string(54) "
+string(%d) "hi<\/b>")%r>
"
string(12) "quote "test""
-string(45) "
+string(%d) "
"
string(12) "quote 'test'"
string(45) "