<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/langref.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'language.operators.php',
    1 => 'Operators',
    2 => 'Operators',
  ),
  'up' => 
  array (
    0 => 'langref.php',
    1 => 'Language Reference',
  ),
  'prev' => 
  array (
    0 => 'language.expressions.php',
    1 => 'Expressions',
  ),
  'next' => 
  array (
    0 => 'language.operators.precedence.php',
    1 => 'Operator Precedence',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/operators.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/language.operators.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="language.operators" class="chapter">
 <h1 class="title">Operators</h1>
<h2>Table of Contents</h2><ul class="chunklist chunklist_chapter"><li><a href="language.operators.precedence.php">Operator Precedence</a></li><li><a href="language.operators.arithmetic.php">Arithmetic</a></li><li><a href="language.operators.increment.php">Increment and Decrement</a></li><li><a href="language.operators.assignment.php">Assignment</a></li><li><a href="language.operators.bitwise.php">Bitwise</a></li><li><a href="language.operators.comparison.php">Comparison</a></li><li><a href="language.operators.errorcontrol.php">Error Control</a></li><li><a href="language.operators.execution.php">Execution</a></li><li><a href="language.operators.logical.php">Logic</a></li><li><a href="language.operators.string.php">String</a></li><li><a href="language.operators.array.php">Array</a></li><li><a href="language.operators.type.php">Type</a></li><li><a href="language.operators.functional.php">Functional</a></li></ul>

 <p class="simpara">
  An operator is something that takes one or more values (or
  expressions, in programming jargon) and yields another value (so that the
  construction itself becomes an expression).
 </p>
 <p class="para">
  Operators can be grouped according to the number of values they take. Unary
  operators take only one value, for example <code class="literal">!</code> (the
  <a href="language.operators.logical.php" class="link">logical not operator</a>) or
  <code class="literal">++</code> (the
  <a href="language.operators.increment.php" class="link">increment operator</a>).
  Binary operators take two values, such as the familiar
  <a href="language.operators.arithmetic.php" class="link">arithmetical operators</a>
  <code class="literal">+</code> (plus) and <code class="literal">-</code> (minus), and the
  majority of PHP operators fall into this category. Finally, there is a
  single <a href="language.operators.comparison.php#language.operators.comparison.ternary" class="link">ternary
  operator</a>, <code class="literal">? :</code>, which takes three values; this is
  usually referred to simply as &quot;the ternary operator&quot; (although it could
  perhaps more properly be called the conditional operator).
 </p>
 <p class="para">
  A full list of PHP operators follows in the section
  <a href="language.operators.precedence.php" class="link">Operator Precedence</a>.
  The section also explains operator precedence and associativity, which govern
  exactly how expressions containing several different operators are
  evaluated.
 </p>

 


 


 


 


 


 


 


 


 


 


 


 


 



</div>
<?php manual_footer($setup); ?>