Improved PHP demo code so it uses a function declaration and call