This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
Open
Description
Our project is using Zend filters for security purposes. For example, we might want to ensure that a text input contains an integer using Zend\Filter\ToInt. filter() gives us the guarantee that the returned value is an integer. Unfortunately, it may quietly alter the input.
If the input is string "3" and the output is int 3, there is no problem.
But if the input is string "four" and the output is 0, there is a problem - either the wrong filter was used, or the UI should not have let "four" be entered.
To ensure that problems are detected, filter() should warn when an actual alteration is done, for example by triggering a PHP warning.