-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Two equivalent syntax of yaml-Collections produce different output for the same values #44019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you please try #44034? |
…xabbuh) This PR was merged into the 4.4 branch. Discussion ---------- [Yaml] don't try to replace references in quoted strings | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44019 | License | MIT | Doc PR | Commits ------- 20555ad don't try to replace references in quoted strings
Work fine now for quoted string, but still broken for
|
You are right. There was an issue with how we handled quoted scalars tagged with parameters:
# Correct output
#
# bin/console debug:container --parameters
# output -> ["&string"]
collection_output_correct:
- !!str '&string'
# Wrong output
#
# bin/console debug:container --parameters
# output -> [""]
collection_output_wrong: [!!str '&string'] |
But what about Still two equivalent syntax of yaml-Collections produce different output:
|
You have to quote them. If I do not miss anything, this simply is how it is supposed to be done according to the spec. |
I have nothing against this or that specification. I disagree only with the fact that for the same expression, depending on the form of writing the collection (in one line or column), the parser gives different results. |
I was under the expression that the first one would now also end with an empty string. If that’s not the case that should be fixed as well. |
Hey, thanks for your report! |
Symfony version(s) affected
Tested and reproduced on 4.4 and 5.3
Description
In case the first character of the string is ampersand
&
, then two equivalent syntax of YAML-Collections produce different output for the same values.How to reproduce
Add YAML parameters like:
Run
bin/console debug:container --parameters
and compare output for 'collection_output_correct' and 'collection_output_wrong' parameters.Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: