Fixed php error for "in" operator

I have added the tests and also fixed the php error ``An exception has been thrown during the rendering of a template ("strlen() expects parameter 1 to be string, array given")``.