[Yaml] inline syntax: remove object support

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #6498
| License       | MIT
| Doc PR        |

I think the exception can be thrown for any object, not just PHP ones.