Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 6501

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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>&quot;Adds&quot; two variant values together and returns the result</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.variant-abs.html">variant_abs</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.variant-and.html">variant_and</a></div>
 <div class="up"><a href="ref.com.html">COM Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.variant-add" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">variant_add</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">variant_add</span> &mdash; <span class="dc-title">&quot;Adds&quot; two variant values together and returns the result</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.variant-add-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <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>
   )</div>

  <p class="para rdfs-comment">
   Adds <em><code class="parameter">left</code></em> to <em><code class="parameter">right</code></em> 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">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">left</code></em></span>
     <dd>

      <p class="para">
       The left operand.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">right</code></em></span>
     <dd>

      <p class="para">
       The right operand.
      </p>
     </dd>

    </dt>

   </dl>

   <blockquote class="note"><p><strong class="note">Note</strong>: 
<p class="para">
 As with all the variant arithmetic functions, the parameters for this function
 can be either a PHP native type (integer, string, floating point, boolean or
 <strong><code>NULL</code></strong>), or an instance of a COM, VARIANT or DOTNET class.  PHP native types
 will be converted to variants using the same rules as found in the constructor
 for the <a href="class.variant.html" class="xref">VARIANT</a> class.  COM and DOTNET objects
 will have the value of their default property taken and used as the variant value.
</p>
<p class="para">
 The variant arithmetic functions are wrappers around the similarly named
 functions in the COM library; for more information on these functions, consult
 the MSDN library.  The PHP functions are named slightly differently; for example
  <span class="function"><strong>variant_add()</strong></span> in PHP corresponds to <em>VarAdd()
 </em> in the MSDN documentation.
</p>
</p></blockquote>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.variant-add-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the result.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.variant-add-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.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><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.variant-abs.html">variant_abs</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.variant-and.html">variant_and</a></div>
 <div class="up"><a href="ref.com.html">COM Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>