Enjoyable php algorithms