Initialize property for serializers

Serializers and test frameworks skip the constructor using
serialization tricks. This means that if an empty Pimple instance is
serialized and later deserialized that the $values property contains
'null'. This breaks offsetExists() and several other locations that 
assume the $values property contains an array.
merged branch mvriel/patch-1 (PR #56)

This PR was merged into the master branch.

Commits
-------

53ec09c Initialize property for serializers

Discussion
----------

Initialize property for serializers

Serializers and test frameworks skip the constructor using
serialization tricks. This means that if an empty Pimple instance is
serialized and later deserialized that the $values property contains
'null'. This breaks offsetExists() and several other locations that
assume the $values property contains an array.

---------------------------------------------------------------------------

by igorw at 2012-12-18T01:36:38Z

Serializing a pimple instance? Sounds scary.

Btw, see also #54 which is a superset of this PR.

---------------------------------------------------------------------------

by stof at 2012-12-18T10:01:06Z

Yeah, Pimple is meant to contain closures so serializing it sounds really scary

---------------------------------------------------------------------------

by mvriel at 2012-12-18T10:36:20Z

Apparently PHPUnit does it since all my unit tests fail unless I add that initializer. Perhaps I can tweak a setting in PHPUnit to resolve this but haven't had time to dive into which option that should be

---------------------------------------------------------------------------

by SergSerbin at 2012-12-18T11:36:12Z

For PHPUnit you should be able to solve it with adding  ` @backupGlobals disabled` to the phpDoc of a test method (or test class) definition.
http://www.phpunit.de/manual/current/en/appendixes.annotations.html

---------------------------------------------------------------------------

by igorw at 2013-01-13T20:58:09Z

My PR which included this change was closed. @fabpot This PR should be merged.