variant_mul

(PHP 5, PHP 7, PHP 8)

variant_mulMultiplies the values of the two variants

Descripción

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

Multiplies left by right.

Parámetros

left

The left operand.

right

The right operand.

Boolean values are converted to -1 for false and 0 for true.

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 Multiplication Rules
IfThen
Both expressions are of the string, date, character, boolean typeMultiplication
One expression is a string type and the other a characterMultiplication
One expression is numeric and the other is a stringMultiplication
Both expressions are numericMultiplication
Either expression is NULLNULL is returned
Both expressions are emptyEmpty string is returned

Errores/Excepciones

Throws a com_exception on failure.

Ver también

  • variant_div() - Returns the result from dividing two variants
  • variant_idiv() - Converts variants to integers and then returns the result from dividing them
To Top