mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
68 lines
2.4 KiB
XML
68 lines
2.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<chapter xml:id="language.operators" xmlns="http://docbook.org/ns/docbook" annotations="interactive">
|
|
<title>Operators</title>
|
|
<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).
|
|
</simpara>
|
|
<para>
|
|
Operators can be grouped according to the number of values they take. Unary
|
|
operators take only one value, for example <literal>!</literal> (the
|
|
<link linkend="language.operators.logical">logical not operator</link>) or
|
|
<literal>++</literal> (the
|
|
<link linkend="language.operators.increment">increment operator</link>).
|
|
Binary operators take two values, such as the familiar
|
|
<link linkend="language.operators.arithmetic">arithmetical operators</link>
|
|
<literal>+</literal> (plus) and <literal>-</literal> (minus), and the
|
|
majority of PHP operators fall into this category. Finally, there is a
|
|
single <link linkend="language.operators.comparison.ternary">ternary
|
|
operator</link>, <literal>? :</literal>, which takes three values; this is
|
|
usually referred to simply as "the ternary operator" (although it could
|
|
perhaps more properly be called the conditional operator).
|
|
</para>
|
|
<para>
|
|
A full list of PHP operators follows in the section
|
|
<link linkend="language.operators.precedence">Operator Precedence</link>.
|
|
The section also explains operator precedence and associativity, which govern
|
|
exactly how expressions containing several different operators are
|
|
evaluated.
|
|
</para>
|
|
|
|
&language.operators.precedence;
|
|
&language.operators.arithmetic;
|
|
&language.operators.increment;
|
|
&language.operators.assignment;
|
|
&language.operators.bitwise;
|
|
&language.operators.comparison;
|
|
&language.operators.errorcontrol;
|
|
&language.operators.execution;
|
|
&language.operators.logical;
|
|
&language.operators.string;
|
|
&language.operators.array;
|
|
&language.operators.type;
|
|
&language.operators.functional;
|
|
|
|
</chapter>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|