diff -ru src/Symfony/Component/Serializer/Encoder/XmlEncoder.php src/Symfony/Component/Serializer/Encoder/XmlEncoder.php --- src/Symfony/Component/Serializer/Encoder/XmlEncoder.php 2024-04-23 13:25:02.290176650 +0000 +++ src/Symfony/Component/Serializer/Encoder/XmlEncoder.php 2024-04-23 13:25:10.216454218 +0000 @@ -401,7 +401,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)))); } /**