PHP generator based on distribution