2017 © Pedro Peláez
 

library intdiv-compat

A compatibility library for the simplified intdiv function in PHP 7: https://wiki.php.net/rfc/intdiv

image

michaelc/intdiv-compat

A compatibility library for the simplified intdiv function in PHP 7: https://wiki.php.net/rfc/intdiv

  • Tuesday, October 20, 2015
  • by michaelcullum
  • Repository
  • 1 Watchers
  • 4 Stars
  • 1,298 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 24 % Grown

The README.md

intdiv_compat

Travis CI, (*1)

This library/polyfill provides the intdiv function that was added in PHP 7 in PHP 5.3 and later., (*2)

For more information see the RFC., (*3)

Requirements

Requires PHP 5.3.0 or later due to exceptions, (*4)

Installation

Either require the src/intdiv.php file or install using Composer, (*5)

composer require michaelc/intdiv-compat, (*6)

Usage

int intdiv ( int $dividend , int $divisor ), (*7)

Returns the integer quotient of the division of dividend by divisor, (*8)

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., (*9)

See http://php.net/manual/en/function.intdiv.php for more information, (*10)

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., (*11)

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., (*12)

This library can be safely included on a system running PHP 7 and it will not affect core PHP 7 intdiv() usage., (*13)

Tests

To run tests:, (*14)

  composer install
  vendor/bin/phpunit

The Versions

20/10 2015

dev-master

9999999-dev https://github.com/michaelcullum/intdiv_compat

A compatibility library for the simplified intdiv function in PHP 7: https://wiki.php.net/rfc/intdiv

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

division

20/10 2015

dev-revert-2-patch-1

dev-revert-2-patch-1 https://github.com/michaelcullum/intdiv_compat

A compatibility library for the simplified intdiv function in PHP 7: https://wiki.php.net/rfc/intdiv

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

division

19/10 2015

1.0.1

1.0.1.0 https://github.com/michaelcullum/intdiv_compat

A compatibility library for the simplified intdiv function in PHP 7: https://wiki.php.net/rfc/intdiv

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

division

19/10 2015

1.0.0

1.0.0.0 https://github.com/michaelcullum/intdiv_compat

A compatibility library for the simplified intdiv function in PHP 7: https://wiki.php.net/rfc/intdiv

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

division