The Cipher instance is stateful and in the code above we set a different IV.
In cases where the php process might be shared (who knows, we had the case with libxml states before), I chose to not cache the Cipher instance in a static attribute and re-create it every time it is needed.
Does that make sense ?