V1: Quick PHP implementation