|
Size: | 9316 |
Storage flags: | no_autoload,compress/gzip (32%) |
Zend\Filter\ToInt allows you to transform a scalar value which contains into an integer.
There are no additional options for Zend\Filter\ToInt.
A basic example of usage is below:
1 2 3 | $filter = new Zend\Filter\ToInt();
print $filter->filter('-4 is less than 0');
|
This will return ‘-4’.
Version 2.4 adds support for PHP 7. In PHP 7, int is a reserved keyword, which required renaming the Int filter. If you were using the Int filter directly previously, you will now receive an E_USER_DEPRECATED notice on instantiation. Please update your code to refer to the ToInt class instead.
Users pulling their Int filter instance from the filter plugin manager receive a ToInt instance instead starting in 2.4.0.
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.