PHP 8.1.28 Released!

variant_idiv

(PHP 5, PHP 7, PHP 8)

variant_idivConverts variants to integers and then returns the result from dividing them

Descripción

variant_idiv(mixed $left, mixed $right): variant

Converts left and right to integer values, and then performs integer division.

Parámetros

left

The left operand.

right

The right operand.

Nota:

Al igual que con todas las funciones aritméticas variantes, los parámetros de esta función pueden ser tanto un tipo nativo de PHP (integer, string, de punto flotante, boolean o null), o una instancia de una clase COM, VARIANT o DOTNET. Los tipos nativos de PHP serán convertidos en variantes usando las mismas reglas tal como se encuentran en el constructor para la clase variant. Los objetos COM y DOTNET tomarán el valor de sus propiedades predeterminadas adoptadas y lo utilizarán como el valor variante.

Las funciones aritméticas variantes son wrappers alrededor de las funciones con nombres similares en la librería COM; para más información sobre estas funciones, consulte la librería MSDN. Las funciones de PHP tienen nombres ligeramente diferentes; por ejemplo, variant_add() en PHP corresponde a VarAdd() en la documentación MSDN.

Valores devueltos

Variant Integer Division Rules
If Then
Both expressions are of the string, date, character, boolean type Division and integer is returned
One expression is a string type and the other a character Division
One expression is numeric and the other is a string Division
Both expressions are numeric Division
Either expression is NULL NULL is returned
Both expressions are empty A com_exception with code DISP_E_DIVBYZERO is thrown

Errores/Excepciones

Throws a com_exception on failure.

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top