Fixed PHP generation behavior so it matches the ruby and javascript ones.