Edit: Solved it, answer below. In the past week I've been trying to convert some Java code to PHP without any luck. It's a Hearthstone (card game) deck code decoding code (sounds weird...). The code is a base64 string, which uses a lot of varint arrays.
More information here: https://hearthsim.info/docs/deckstrings/
Only Java and C# code is available. Anyone could give some insights on how to convert java code to php?
Any help would be greatly appreciated!