Skip to content

Doctrine Error: Expected Plain Value

Mar 19, 2015 1 min read #php

This post is more than 18 months old. Technology changes quickly, so some of this content may be out of date (but that's not always the case). Please verify any technical or programming information against the current release.

I’m so used to PHP’s liberal allowance for single and double quotes, that I forget that other languages and tool-sets don’t play that way. Case in point, my most recent error:

[Syntax Error] Expected PlainValue, got ''' at position 378 in class My\Bundle\App\Entity\ItemDefinition.
output

It was actually pretty difficult to search for ' - so hopefully this will help someone else who is looking. The solution?

Drum-roll please: It’s because in an annotation, single quotes were used instead of the required double quotes.