diff --git a/src/Symfony/Component/Console/Input/InputDefinition.php b/src/Symfony/Component/Console/Input/InputDefinition.php
index 9551e968c4..2db9222f1e 100644
--- a/src/Symfony/Component/Console/Input/InputDefinition.php
+++ b/src/Symfony/Component/Console/Input/InputDefinition.php
@@ -526,10 +526,6 @@ class InputDefinition
private function formatDefaultValue($default)
{
- if (is_array($default) && $default === array_values($default)) {
- return sprintf("array('%s')", implode("', '", $default));
- }
-
- return str_replace("\n", '', var_export($default, true));
+ return json_encode($default);
}
}
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt
index f717033ad3..cad7dd5e32 100644
--- a/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt
+++ b/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt
@@ -3,7 +3,7 @@ Usage:
Arguments:
command The command to execute
- command_name The command name (default: 'help')
+ command_name The command name (default: "help")
Options:
--xml To output help as XML
diff --git a/src/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt b/src/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt
index 2ad6078e8b..9dd539088a 100644
--- a/src/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt
+++ b/src/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt
@@ -1,11 +1,11 @@
Arguments:
foo The foo argument
baz The baz argument (default: true)
- bar The bar argument (default: array('bar'))
+ bar The bar argument (default: ["bar"])
Options:
--foo (-f) The foo option
--baz The baz option (default: false)
- --bar (-b) The bar option (default: 'bar')
- --qux The qux option (default: array('foo', 'bar')) (multiple values allowed)
- --qux2 The qux2 option (default: array ( 'foo' => 'bar',)) (multiple values allowed)
+ --bar (-b) The bar option (default: "bar")
+ --qux The qux option (default: ["foo","bar"]) (multiple values allowed)
+ --qux2 The qux2 option (default: {"foo":"bar"}) (multiple values allowed)