SimpleXMLElement::addChild(): Argument #1 ($qualifiedName) must be of type string, int given
- Langage dominant
- PHP
- Étoiles
- 0
- Forks
- 0
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Xml::toXml 39行 self::toXml($value, $xml->addChild($key)); 当传入的数据为列表时,该处没有处理key为数字的情况,如:参数为
[
'item' => [
[
'itemCode' => '5110093',
'itemId' => '10415'
],
[
'itemCode' => '5110092',
'itemId' => '10412'
],
]
]
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Start at Xml::toXml around line 39 and reproduce the failure with the nested list shown in the issue. Inspect how numeric keys reach SimpleXMLElement::addChild(); done means the example data can be converted to XML without the qualifiedName type error.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- php
- Domaine
- backend
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100