PHP cli and validator implementation