PHP 8.3.4 Released!

variant_sub

(PHP 5, PHP 7, PHP 8)

variant_subSubtracts the value of the right variant from the left variant value

Descripción

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

Subtracts right from left.

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 Subtraction Rules
If Then
Both expressions are of the string type Subtraction
One expression is a string type and the other a character Subtraction
One expression is numeric and the other is a string Subtraction.
Both expressions are numeric Subtraction
Either expression is NULL NULL is returned
Both expressions are empty Empty string is returned

Errores/Excepciones

Throws a com_exception on failure.

Ver también

  • variant_add() - "Adds" two variant values together and returns the result

add a note

User Contributed Notes

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