(PHP 7)
intdiv — �Գ������ȡ��
$dividend
, int $divisor
) : int
���� dividend
���� divisor
�������������֡�
dividend
��������
divisor
������
dividend
���� divisor
���̣��Ը���ȡ����
��� divisor
�� 0�����׳� DivisionByZeroError �쳣��
��� dividend
�� PHP_INT_MIN
���� divisor
�� -1�����׳� ArithmeticError �쳣.
Example #1 intdiv() ��һЩ����
<?php
var_dump(intdiv(3, 2));
var_dump(intdiv(-3, 2));
var_dump(intdiv(3, -2));
var_dump(intdiv(-3, -2));
var_dump(intdiv(PHP_INT_MAX, PHP_INT_MAX));
var_dump(intdiv(PHP_INT_MIN, PHP_INT_MIN));
var_dump(intdiv(PHP_INT_MIN, -1));
var_dump(intdiv(1, 0));
?>
int(1) int(-1) int(-1) int(1) int(1) int(1) Fatal error: Uncaught ArithmeticError: Division of PHP_INT_MIN by -1 is not an integer in %s on line 8 Fatal error: Uncaught DivisionByZeroError: Division by zero in %s on line 9