michaelc/intdiv-compat
最新稳定版本:1.0.1
Composer 安装命令:
composer require michaelc/intdiv-compat
包简介
A compatibility library for the simplified intdiv function in PHP 7: https://wiki.php.net/rfc/intdiv
关键字:
README 文档
README
This library/polyfill provides the intdiv function that was added in PHP 7 in PHP 5.3 and later.
For more information see the RFC.
Requirements
Requires PHP 5.3.0 or later due to exceptions
Installation
Either require the src/intdiv.php file or install using Composer
composer require michaelc/intdiv-compat
Usage
int intdiv ( int $dividend , int $divisor )
Returns the integer quotient of the division of dividend by divisor
If divisor is 0, a DivisionByZeroError exception is thrown. If the dividend is ~PHP_INT_MAX (PHP_INT_MIN was introduced in PHP 7) and the divisor is -1, then an ArithmeticError exception is thrown.
See http://php.net/manual/en/function.intdiv.php for more information
Please note, if you define \Error in userland and it does not extend either \Throwable (Built-in PHP 7) or \Exception then an error will arise as the \Error class will be attempted to be redeclared.
If \Error exists and extends \Throwable or \Exception then we do not redeclare it. If \Error does not exist or exists but does not extend \Throwable or \Exception, we declare it and extend \Exception.
This library can be safely included on a system running PHP 7 and it will not affect core PHP 7 intdiv() usage.
Tests
To run tests:
composer install
vendor/bin/phpunit
统计信息
- 总下载量: 14.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-18