diff -ru src/Symfony/Component/Serializer/Encoder/XmlEncoder.php src/Symfony/Component/Serializer/Encoder/XmlEncoder.php --- src/Symfony/Component/Serializer/Encoder/XmlEncoder.php 2024-10-30 22:18:58.109133477 +0000 +++ src/Symfony/Component/Serializer/Encoder/XmlEncoder.php 2024-10-30 22:19:04.442357769 +0000 @@ -423,7 +423,7 @@ return $this->appendNode($parentNode, $data, $format, $context, 'data'); } - throw new NotEncodableValueException('An unexpected value could not be serialized: '.(!\is_resource($data) ? var_export($data, true) : \sprintf('%s resource', get_resource_type($data)))); + throw new NotEncodableValueException('An unexpected value could not be serialized: '.(!\is_resource($data) ? var_export($data, true) : \sprintf('"%s" resource', get_resource_type($data)))); } /**