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

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/language.operators.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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',
  ),
 
'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',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div>
  <h1>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 Operators</a></li><li><a href="language.operators.assignment.php">Assignment Operators</a></li><li><a href="language.operators.bitwise.php">Bitwise Operators</a></li><li><a href="language.operators.comparison.php">Comparison Operators</a></li><li><a href="language.operators.errorcontrol.php">Error Control Operators</a></li><li><a href="language.operators.execution.php">Execution Operators</a></li><li><a href="language.operators.increment.php">Incrementing/Decrementing Operators</a></li><li><a href="language.operators.logical.php">Logical Operators</a></li><li><a href="language.operators.string.php">String Operators</a></li><li><a href="language.operators.array.php">Array Operators</a></li><li><a href="language.operators.type.php">Type Operators</a></li></ul>

  <p class="simpara">
   An operator is something that you feed with one or more values (or
   expressions, in programming jargon) which yields another value (so that the
   construction itself becomes an expression). So you can think of functions
   or constructions that return a value (like print) as operators and those
   that return nothing (like echo) as any other thing.
  </p>
  <p class="para">
   There are three types of operators.  Firstly there is the unary operator which
   operates on only one value, for example ! (the negation operator) or ++
   (the increment operator). The second group are termed binary operators; this
   group contains most of the operators that PHP supports, and a list follows
   below in the section <a href="language.operators.precedence.php" class="link">Operator
   Precedence</a>.
  </p>
  <p class="para">
   The third group is the ternary operator: ?:.  It should be used to select
   between two expressions depending on a third one, rather than to select two
   sentences or paths of execution. Surrounding ternary expressions with
   parentheses is a very good idea.
  </p>

 

 

 

 

 

 

 

 

 

 

 
 
 </div>
<?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites