(PHP 5)
variant_div — Returns the result from dividing two variants
Divides left by right and returns the result.
The left operand.
The right operand.
Nota: Assim como todas as funções aritméticas variant, os parâmetros para esta função podem ser qualquer um tipo nativo do PHP (integer, string, ponto flutuante, booleano ou NULL), ou uma instancia de uma classe COM, VARIANT ou DOTNET. Tipos nativos do PHP será convertido para variants usando a mesma regra como encontrado no construtor para a classe VARIANT. Objetos COM e DOTNET terão o valor de suas propriedades padrão obtidos e usados como valor variant.
As funções aritméticas variant são wrappers para as chamadas similarmente funções na biblioteca COM; para mais informação sobre estas funções, consulte a biblioteca MSDN. As funções PHP são nomeadas ligeiramente diferentes; por exemplo variant_add() no PHP corresponde a VarAdd() na documentação MSDN.
If | Then |
---|---|
Both expressions are of the string, date, character, boolean type | Double is returned |
One expression is a string type and the other a character | Division and a double is returned |
One expression is numeric and the other is a string | Division and a double is returned. |
Both expressions are numeric | Division and a double is returned |
Either expression is NULL | NULL is returned |
right is empty and left is anything but empty | A com_exception with code DISP_E_DIVBYZERO is thrown |
left is empty and right is anything but empty. | 0 as type double is returned |
Both expressions are empty | A com_exception with code DISP_E_OVERFLOW is thrown |