Get support for michaelcullum/intdiv_compat

If you're new to LTH, please see our FAQ for more information on what it is we do.

Support Options

Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:

View Open Issues

Take a look to see if anyone else has experienced the same issue as you and if they managed to solve it.

Open an Issue

Make sure to read any relevant guidelines for opening issues on this repo before posting a new issue.

Sponsor directly

Check out the page and see if there are any options to sponsor this project or it's developers directly.

michaelcullum/intdiv_compat

intdiv_compat

Travis CI

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
Our Mission

We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.

Interesting Articles

Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated

p-e622a1a2