[YAML] Fix issue #6498 Yaml parsing of serialized PHP objects within array

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #6498
| License       | MIT
| Doc PR        | 

The problem was that when Object is serialized it uses commas and curly brackets. Parser interprets them as yaml delimiters. Logic is now improved.