improve performance for v1.1

I added the performance improvement from v2.x in v1.1, with $keys instead of array_key_exists.
Why? Silex master branch still uses Pimple 1.1, and could be convenient while Silex 2 don't come out.