A PHP validation inspired by Yii