1
0
mirror of https://github.com/php/doc-zh.git synced 2026-03-23 22:52:08 +01:00
Files
archived-doc-zh/language/operators.xml
2025-11-08 11:00:48 +08:00

60 lines
2.4 KiB
XML
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 2946c8a267734a9e8696e1764f7436e6caa8909c Maintainer: jhdxr Status: ready -->
<!-- CREDITS: mowangjuanzi, Luffy -->
<chapter xml:id="language.operators" xmlns="http://docbook.org/ns/docbook" annotations="interactive">
<title>运算符</title>
<simpara>
运算符是可以通过给出的一或多个值(用编程行话来说,表达式)来产生另一个值(因而整个结构成为一个表达式)的东西。
</simpara>
<para>
运算符可按照其能接受几个值来分组。一元运算符只能接受一个值,例如
<literal>!</literal><link linkend="language.operators.logical">逻辑取反运算符</link>)或
<literal>++</literal><link linkend="language.operators.increment">递增运算符</link>)。
二元运算符可接受两个值,例如熟悉的<link
linkend="language.operators.arithmetic">算术运算符</link>
<literal>+</literal>(加)和 <literal>-</literal>(减),大多数 PHP
运算符都是这种。最后是唯一的<link
linkend="language.operators.comparison.ternary">三元运算符</link> <literal>? :</literal>,可接受三个值;通常就简单称之为“三元运算符”(尽管称之为条件运算符可能更合适)。
</para>
<para>
PHP 的运算符完整列表见下节<link
linkend="language.operators.precedence">运算符优先级</link>。该节也解释了运算符优先级和结合方向,这控制着在表达式包含有若干个不同运算符时究竟怎样对其求值。
</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
-->