#163 Fixed code to work in PHP