[DOC-CVS] [doc-en] master: Document special handling for "&" in SimpleXml::addChild()

[email protected] (Christian Weiske) Thu, 5 Mar 2026 13:33:10 +0000
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Christian Weiske (cweiske)
Date: 2026-03-05T14:33:07+01:00

Commit: https://github.com/php/doc-en/commit/dca2a8354fc170f26545210ac78424ccc30950ea
Raw diff: https://github.com/php/doc-en/commit/dca2a8354fc170f26545210ac78424ccc30950ea.diff

Document special handling for "&" in SimpleXml::addChild()

See the comments section for that page: https://www.php.net/manual/en/simplexmlelement.addchild.php

Changed paths:
  M  reference/simplexml/simplexmlelement/addChild.xml


Diff:

diff --git a/reference/simplexml/simplexmlelement/addChild.xml b/reference/simplexml/simplexmlelement/addChild.xml
index 222c4ba0684a..3fd8f0c0a4f4 100644
--- a/reference/simplexml/simplexmlelement/addChild.xml
+++ b/reference/simplexml/simplexmlelement/addChild.xml
@@ -38,6 +38,10 @@
       <para>
        If specified, the value of the child element.
       </para>
+      <para>
+       Special characters <literal>&lt;</literal> and <literal>&gt;</literal> get escaped
+       automatically, <literal>&amp;</literal> must be escaped manually.
+      </para>
      </listitem>
     </varlistentry>
     <varlistentry>