downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

variant_and> <variant_abs
[edit] Last updated: Fri, 18 Sep 2009

view this page in

variant_add

(PHP 5)

variant_add"Adds" two variant values together and returns the result

Описание

mixed variant_add ( mixed $left , mixed $right )

Adds left to right using the following rules (taken from the MSDN library), which correspond to those of Visual Basic:

Variant Addition Rules
If Then
Both expressions are of the string type Concatenation
One expression is a string type and the other a character Addition
One expression is numeric and the other is a string Addition
Both expressions are numeric Addition
Either expression is NULL NULL is returned
Both expressions are empty Integer subtype is returned

Параметри

left

The left operand.

right

The right operand.

Забележка: Както и при останалите функции за вариантна аритметика, параметрите на тази функция могат да бъдат както от прост тип в PHP (целочислен, низ, плаващ, булев или NULL), така и инстанция някой от класовете COM, VARIANT или DOTNET. Простите типове в PHP ще бъдат преобразувани до варианти според същите правила, използвани от конструктора на класа VARIANT. Обектите COM и DOTNET ще вземат стйността на свойството им по подразбиране и ще използват тази стойност като стойност на варианта.
Функциите за вариантна аритметика са опаковки на именуваните по подобен начин функции в библиотеката COM; за повече информация относно тези функции се консултирайте с библиотеката MSDN. Функциите в PHP са именувани малко по-различно; например variant_add() в PHP отговаря на VarAdd() в документацията на MSDN.

Връщани стойности

Returns the result.

Вж. също

  • variant_sub() - Subtracts the value of the right variant from the left variant value



add a note add a note User Contributed Notes variant_add - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites