Shamir's Shared Secret Implementation in PHP