Move the code from PhpReferenceCompatibility to this file and remove the old one