Add Class-based PHP implementation and tests
Merge remote-tracking branch 'github/redragonx-compatible' into compatible-versions