zendframework/zf2 — pull request #3164 by alexdenvir (2012-12-04 15:26:36+00:00)
Title: Cast $step to float in \Zend\Validator\Step

When creating a Number element on a form, setting a step attribute of 0.01 (for example, to accept a currency value) adds a Step validator to its validators.

If the number element is created with a string for the step attribute , eg: '0.01', instead of a float, this value is set as a string in the validator.

The is valid function uses strict comparisons between the float value returned by fmod and the step value, and naturally 0.01 !== '0.01'.

This pull request simply casts the value of step to float in the setStep function.