mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-17 21:16:57 +08:00
143 lines
4.3 KiB
HTML
143 lines
4.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title>"Adds" two variant values together and returns the result</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.variant-add" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">variant_add</h1>
|
||
<p class="verinfo">(PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">variant_add</span> — <span class="dc-title">"Adds" two variant values together and returns the result</span></p>
|
||
|
||
</div>
|
||
<div class="refsect1 description" id="refsect1-function.variant-add-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>variant_add</strong></span>
|
||
( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$left</code></span>
|
||
, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$right</code></span>
|
||
) : <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
Adds <code class="parameter">left</code> to <code class="parameter">right</code> using
|
||
the following rules (taken from the MSDN library), which correspond to
|
||
those of Visual Basic:
|
||
<table class="doctable table">
|
||
<caption><strong>Variant Addition Rules</strong></caption>
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>If</th>
|
||
<th>Then</th>
|
||
</tr>
|
||
|
||
</thead>
|
||
|
||
<tbody class="tbody">
|
||
<tr>
|
||
<td>Both expressions are of the string type</td>
|
||
<td>Concatenation</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>One expression is a string type and the other a
|
||
character</td>
|
||
<td>Addition</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>One expression is numeric and the other is a string</td>
|
||
<td>Addition</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>Both expressions are numeric</td>
|
||
<td>Addition</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>Either expression is NULL</td>
|
||
<td>NULL is returned</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>Both expressions are empty</td>
|
||
<td>Integer subtype is returned</td>
|
||
</tr>
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.variant-add-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">left</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
The left operand.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">right</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
The right operand.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
<blockquote class="note"><p><strong class="note">Note</strong>:
|
||
<p class="para">
|
||
对于所有变量运算函数,本函数的参数可以是 PHP
|
||
内置的类型(整数,字符串,浮点数,布尔型或者
|
||
<strong><code>NULL</code></strong>),或者是一个 COM,VARIANT 或者 DOTNET 类的实例。PHP
|
||
内置类型将会使用和构造<a href="class.variant.html" class="xref">VARIANT</a>类相同的规则转换成变量。COM 和 DOTNET
|
||
对象的值将会取其默认属性并被当成变量值使用。
|
||
</p>
|
||
<p class="para">
|
||
变量运算函数是同名函数在 COM
|
||
库中的外包;有关此类函数的更多信息参见 MSDN
|
||
库。PHP 函数命名有少许区别,例如 PHP
|
||
中的 <span class="function"><strong>variant_add()</strong></span> 对应于
|
||
MSDN 文档中的 <em>VarAdd()</em>。
|
||
</p>
|
||
</p></blockquote>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.variant-add-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
Returns the result.
|
||
</p>
|
||
</div>
|
||
|
||
<div class="refsect1 seealso" id="refsect1-function.variant-add-seealso">
|
||
<h3 class="title">参见</h3>
|
||
<p class="para">
|
||
<ul class="simplelist">
|
||
<li class="member"><span class="function"><a href="variant_sub.html" class="function" rel="rdfs-seeAlso">variant_sub()</a> - Subtracts the value of the right variant from the left variant value</span></li>
|
||
</ul>
|
||
</p>
|
||
</div>
|
||
|
||
</div></div></div></body></html> |