reiventing the wheel over and over again. php 5.3