diff --git a/src/Symfony/Bridge/Twig/Extension/YamlExtension.php b/src/Symfony/Bridge/Twig/Extension/YamlExtension.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bridge/Twig/Extension/YamlExtension.php
+++ b/src/Symfony/Bridge/Twig/Extension/YamlExtension.php
@@ -39,6 +39,10 @@ class YamlExtension extends \Twig_Extension
             $dumper = new YamlDumper();
         }
 
+        if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) {
+            $dumpObjects = (int) $dumpObjects;
+        }
+
         return $dumper->dump($input, $inline, 0, false, $dumpObjects);
     }
[TwigBridge] forward compatibility with Yaml <I>