cvs: phpdoc-he /language types.xml
[email protected] ("Moshe Doron") Wed, 30 Jul 2003 11:01:52 -0000
| Newsgroups | php.doc.he |
|---|---|
| Message-ID | <cvsmomo1059562912@cvsserver> |
momo Wed Jul 30 07:01:52 2003 EDT
Modified files:
/phpdoc-he/language types.xml
Log:
continuing....
momo-20030730070152.txt
(text/plain, 19 KB)
Index: phpdoc-he/language/types.xml
diff -u phpdoc-he/language/types.xml:1.7 phpdoc-he/language/types.xml:1.8
--- phpdoc-he/language/types.xml:1.7 Sat May 17 15:40:08 2003
+++ phpdoc-he/language/types.xml Wed Jul 30 07:01:52 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="WINDOWS-1255"?>
-<!--EN-Revision: 1.74 Maintainer: tal Status: working -->
+<!--EN-Revision: 1.74 Maintainer: momo Status: working -->
<chapter id="language.types">
<title>ñåâé ðúåðéí</title>
@@ -251,17 +251,17 @@
</para>
<sect2 id="language.types.integer.syntax">
- <title>Syntax</title>
+ <title>úçáéø</title>
<simpara>
- Integers can be specified in decimal (10-based), hexadecimal (16-based)
- or octal (8-based) notation, optionally preceded by a sign (- or +).
+ ùìîéí éëåìéí ìäøùí ëîñôøéí ã÷ñéîéàìééí (áñéñ ñôéøä 10), ä÷ñàã÷ñéîéàìééí (áñéñ ñôéøä 16)
+ àå àå÷èàìéí (áñéñ 8), ìäí éúëï åéå÷ãí ñéîåï (- àå +).
</simpara>
<para>
- If you use the octal notation, you must precede the number with a
- <literal>0</literal> (zero), to use hexadecimal notation precede
- the number with <literal>0x</literal>.
+ àí äîñôø àå÷èàìé, òìéê ìä÷ãéí ìå
+ <literal>0</literal> (àôñ), ìëúéáú äîñôø ëä÷ñà òìéê ìä÷ãéí ìå
+ <literal>0x</literal>.
<example>
- <title>Integer literals</title>
+ <title>ëúéáú ùìîéí</title>
<programlisting role="php">
<![CDATA[
$a = 1234; # decimal number
@@ -275,31 +275,28 @@
decimal : [1-9][0-9]*
| 0
-
+
hexadecimal : 0[xX][0-9a-fA-F]+
-
+
octal : 0[0-7]+
-
+
integer : [+-]?decimal
| [+-]?hexadecimal
| [+-]?octal
-
+
-->
- The size of an integer is platform-dependent, although a
- maximum value of about two billion is the usual value
- (that's 32 bits signed). PHP does not support unsigned
- integers.
+ äâåãì ùì ùìí äåà úìåé áúöåøä, àó òì ôé ùìøåá äòøê äåà ÷öú éåúø îùðé îéìéàøã
+ (òáåø 32 áéè). PHP ìà úåîê áùìîéí "áëéååï àçã" (unsigned integers),
+ ëìåîøú ùìîéí äéëåìéí ì÷áì òøê çéåáé áìáã åòì éãé ëê äòøê äî÷ñéîìé îåëôì.
</para>
</sect2>
-
+
<sect2 id="language.types.integer.overflow">
- <title>Integer overflow</title>
+ <title>âìéùä áùìîéí</title>
<para>
- If you specify a number beyond the bounds of the <type>integer</type>
- type, it will be interpreted as a <type>float</type> instead. Also, if
- you perform an operation that results in a number beyond the bounds of
- the <type>integer</type> type, a <type>float</type> will be returned
- instead.
+ àí ëúáú îñôø äçåøâ îâáåìåú ä<type>ùìí</type>,
+ äåà éôåøù áî÷åí æàú ë<type>îñôø ð÷åãä öôä</type>. áðåñó, àí ëúåöàä îôòåìä ùáéöòú <type>äùìí</type> çøâ îèååçéå, äåà éäôåê ì <type>îñôø ð÷åãä öôä</type>
+ áî÷åí æàú.
<informalexample>
<programlisting role="php">
@@ -325,21 +322,18 @@
</informalexample>
<warning>
<simpara>
- Unfortunately, there was a bug in PHP so that this
- does not always work correctly when there are negative numbers
- involved. For example: when you do <literal>-50000 *
- $million</literal>, the result will be
- <literal>-429496728</literal>. However, when both operands are
- positive there is no problem.
+ ìîøáä äöòø, áâìì áàâ áPHP äãáø àéððå òåáã ëäìëä ëàùø îòåøáéí îñôøéí ùìéìééí. ìãåâîà: ëàùø àúä òåùä <literal>-50000 *
+ $million</literal>, äúåöàä äéà
+ <literal>-429496728</literal>. îëì î÷åí, ëàùø ùðé äàåôøðãéí äí ùìéìééí, ìà ÷ééîú áòéä.
</simpara>
<simpara>
- This is solved in PHP 4.1.0.
+ áàâ æä ðôúø äçì îPHP 4.1.0
</simpara>
</warning>
</para>
<para>
- There is no integer division operator in PHP.
- <literal>1/2</literal> yields the <type>float</type>
+ àéï àåôøèåø äîçì÷ îñôøéí ùìîéí áPHP.
+ <literal>1/2</literal>îôé÷ <type>ð÷åãä öôä</type>
<literal>0.5</literal>. <!-- See ??? for more information. (with the
operators, or with type-jug) -->
<informalexample>
@@ -352,51 +346,46 @@
</informalexample>
</para>
</sect2>
-
+
<sect2 id="language.types.integer.casting">
- <title>Converting to integer</title>
+ <title>äîøä ìùìîéí</title>
<simpara>
- To explicitly convert a value to <type>integer</type>, use either
- the <literal>(int)</literal> or the <literal>(integer)</literal> cast.
- However, in most cases you do not need to use the cast, since a value
- will be automatically converted if an operator, function or
- control structure requires a <type>integer</type> argument.
+ ìäîéø áîôåøù òøê ì<type>ùìí</type>, äùúîù áàçã îùðé äàôùøåéåú:
+ äîîéø <literal>(int)</literal> àå äîîéø <literal>(integer)</literal>.
+ éù ìäãâéù, ëé áãøê ëìì ìà úöèøê äîøä, îëéååï ùäòøê éåîø àåèåîèéú àí äùéîåù áå éäéä áôåð÷öéä àå îùôè äãåøù ë÷ìè àøâåîðè<type>ùìí</type>.
</simpara>
<simpara>
- See also <link linkend="language.types.type-juggling">type-juggling</link>.
+ øàä âí <link linkend="language.types.type-juggling">ìäèåèðåú ä÷ùåøä áñåâé äîùúðéí</link>.
</simpara>
-
+
<sect3 id="language.types.integer.casting.from-boolean">
- <title>From <link linkend="language.types.boolean"
- >booleans</link></title>
+ <title>äîøä îñôøéí <link linkend="language.types.boolean"
+ >áåìéàðééí</link></title>
<simpara>
- &false; will yield
- <literal>0</literal> (zero), and &true;
- will yield <literal>1</literal> (one).
+ &false; éåîø á
+ <literal>0</literal> (àôñ), å &true;
+ éåîø á <literal>1</literal> (àçã).
</simpara>
</sect3>
<sect3 id="language.types.integer.casting.from-float">
- <title>From <link linkend="language.types.float">floating point numbers</link></title>
+ <title>äîøä <link linkend="language.types.float">îîñôøé ð÷åãä öôä</link></title>
<simpara>
- When converting from float to integer, the number will
- be rounded <emphasis>towards zero</emphasis>.
+ ëàùø îîéøéí îð÷åãä öôä ìùìí, äîñôø éòåâì
+ <emphasis>ìëéååï àôñ</emphasis>.
</simpara>
-
+
<para>
- If the float is beyond the boundaries of integer
+ àí äîñôø äî÷åøé çåøâ îâáåìåú äîñôø äùìí,
<!-- usually, or is it 'always'? -->
- (usually <literal>+/- 2.15e+9 = 2^31</literal>),
- the result is undefined, since the float hasn't
- got enough precision to give an exact integer result.
- No warning, not even a notice will be issued in this
- case!
+ (ìøåá <literal>+/- 2.15e+9 = 2^31</literal>),
+ äúåöàä ìà îåâãøú, îëéååï ùìîñôø äð÷åãä äöôä àéï îñôé÷ ãéå÷ ìãòú ìàéæä îñôø ìòâì.
+ ìà éåôéòå ùåí àúøòåú àå àæäøåú ëàùø îúáöòú äîøä ùëæå!
</para>
-
+
<warning><para>
- Never cast an unknown fraction to <type>integer</type>, as this can
- sometimes lead to unexpected results.
+ ìòåìí àì úîéø ùáø ìà éãåò <type>ìùìí</type>, îëéååï ùæä éëåì ìòéúéí ìäåáéì ìúåöàåú ìà îöåôåú.
<informalexample>
<programlisting role="php">
<![CDATA[
@@ -404,150 +393,132 @@
]]>
</programlisting>
</informalexample>
-
- See for more information the <link
- linkend="warn.float-precision">warning
- about float-precision</link>.
+
+ øàä òåã îéãò àåãåú <link
+ linkend="warn.float-precision">àæäøä ìâáé äãéå÷ ùì îñôøé ð÷åãä öôä</link>.
</para></warning>
</sect3>
-
+
<sect3 id="language.types.integer.casting.from-string">
- <title>From strings</title>
+ <title>îîçøåæåú</title>
<simpara>
- See <link linkend="language.types.string.conversion">String
- conversion</link>
+ øàä <link linkend="language.types.string.conversion">äîøú îçøåæåú</link>
</simpara>
</sect3>
-
+
<sect3 id="language.types.integer.casting.from-other">
- <title>From other types</title>
+ <title>îñåâéí àçøéí</title>
<para>
<caution>
<simpara>
- Behaviour of converting to integer is undefined for other
- types. Currently, the behaviour is the same as if the value
- was first <link linkend="language.types.boolean.casting"
- >converted to boolean</link>. However, do
- <emphasis>not</emphasis> relay on this behaviour, as it can
- change without notice.
+ ääúðäâåú ùì äîøä ìùìîéí àéððå îåâãøú òáåø ñåâéí àçøéí.
+ ðëåï ìòëùéå, äúåöàä úäéä ëàéìå äîùúðä úçéìä <link linkend="language.types.boolean.casting"
+ >äåîø ìîñôø áåìéàðé</link>. îëì î÷åí,
+ <emphasis>àì</emphasis> úñîåê òì äúðäâåú æå, îëéååï ùäéà éëåìä ìäùúðåú ììà ëì àúøòä.
</simpara>
</caution>
</para>
<!--
-
- IMO, it would more sense as (int) $arr returned the
+
+ IMO, it would more sense as (int) $arr returned the
number of elements in $arr. This won't break anything,
- since this behaviour was never defined before, and
+ since this behaviour was never defined before, and
(bool)(int) $arr will still behave the same.
-
+
-->
</sect3>
-
+
</sect2>
</sect1>
<sect1 id="language.types.float">
- <title>Floating point numbers</title>
+ <title>îñôøé ð÷åãä öôä</title>
<para>
- Floating point numbers (AKA "floats", "doubles" or "real numbers") can be
- specified using any of the following syntaxes:
+ îñôøé ð÷åãä öôä (äéãåòéí âí ë "floats", "doubles" àå îñôøéí àîéúééí) éëåìéí ìäéåú îéåöâéí òì éãé ùéîåù áëì àçã îàôðé äúçáéø äáàéí:
<synopsis>
$a = 1.234; $a = 1.2e3; $a = 7E-10;
</synopsis>
- <!--
-
+ <!--
+
LNUM [0-9]+
DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*)
EXPONENT_DNUM (({LNUM}|{DNUM})[eE][+-]?{LNUM})
-
+
-->
- The size of a float is platform-dependent,
- although a maximum of ~1.8e308 with a precision of roughly 14
- decimal digits is a common value (that's 64 bit IEEE format).
+ äâåãì ùì äöôéí úìåé áôìèôåøîä, ìîøåú æàú òøê î÷åáì î÷ñéîìé äåà
+ ~1.8e308 òí ãéå÷ ùì 14 ñôøåú àçøé äð÷åãä äòùøåðéú (äôåøîè IEEE òáåø 64 áéè).
</para>
<warning id="warn.float-precision">
- <title>Floating point precision</title>
+ <title>ãéå÷ ùì öôéí</title>
+ <para>
+ æäå ãáø î÷åáì ùùáø òùøåðé ëâåï
+ <literal>0.1</literal> àå <literal>0.7</literal> ìà éëåì ìäéåú îåîø ìúåê äééöåâ äáéðàøé äùìí ùìäí ììà àáãï ÷ì ùì ãéå÷.
+ ãáø æä éëåì ìäåìéê ìáìáåì îä, ìãåâîà äáéèåé,
+ <literal>floor((0.1+0.7)*10)</literal> éçæéø ìøåá <literal>7</literal> áî÷åí
+ <literal>8</literal> ìå äééðå îöôéí, ùééöâ àú äòøê <literal>7.9999999999...</literal>.
+ </para>
+ <para>
+ æä ðåâò ìòåáãä ùæä áìúé àôùøé ìééöâ îñôø ùáøéí áééöåâ òùøåðé, áòæøú îñôø ñåôé ùì ñôøåú. ìãåâîà,
+ <literal>1/3</literal> áééöåâ òùøåðé äåà <literal>0.3333333. . .</literal>.
+ </para>
<para>
- It is quite usual that simple decimal fractions like
- <literal>0.1</literal> or <literal>0.7</literal> cannot be
- converted into their internal binary counterparts without a
- little loss of precision. This can lead to confusing results: for
- example, <literal>floor((0.1+0.7)*10)</literal> will usually
- return <literal>7</literal> instead of the expected
- <literal>8</literal> as the result of the internal representation
- really being something like <literal>7.9999999999...</literal>.
- </para>
- <para>
- This is related to the fact that it is impossible to exactly
- express some fractions in decimal notation with a finite number
- of digits. For instance, <literal>1/3</literal> in decimal form
- becomes <literal>0.3333333. . .</literal>.
- </para>
- <para>
- So never trust floating number results to the last digit and
- never compare floating point numbers for equality. If you really
- need higher precision, you should use the <link
- linkend="ref.bc">arbitrary precision math functions</link>
- or <link linkend="ref.gmp">gmp</link> functions instead.
+ ìëï ìòåìí àì úñîåê òì öôéí ìâîøé åìòåìí àì úùååä áéï îñôøéí öôéí ì÷áéòä ñåôéú ùì æäåú.
+ àí àúä áàîú öøéê ãéå÷ âáåäú òìéê ìäùúîù á<link
+ linkend="ref.bc">ôåð÷öéåú îúîèéåú òí ãéå÷ áìúé îåâáì</link>
+ àå <link linkend="ref.gmp">gmp</link> áî÷åí.
</para>
</warning>
</sect1>
<sect1 id="language.types.string">
- <title>Strings</title>
+ <title>îçøåæåú</title>
<para>
- A <type>string</type> is series of characters. In PHP,
- a character is the same as a byte, that is, there are exactly
- 256 different characters possible. This also implies that PHP
- has no native support of Unicode.
+ <type>îçøåæú</type> äéà øöó ùì úååéí. áPHP,
+ úå æää ìáéú, ìëï ÷ééîéí áãéå÷ 256 àôùøåéåú ùåðåú ìúååéí.
+ æä âí éåúø îîøîæ ùìPHP àéï úîéëä èáòéú UNICODE.
<!-- how about unicode? will we support that eventually? Are
there current any ways to work with unicode?
-->
</para>
<note>
<simpara>
- It is no problem for a string to become very large.
- There is no practical bound to the size
- of strings imposed by PHP, so there is no reason at all
- to worry about long strings.
+ àéï ëì îâáìä ò÷øåðéí ìâáé äàåøê ùì îçøåæåú, åòì ëï ðåùà îâáìú äàåøê ìà öøéê ìäèøéã àúëí.
</simpara>
</note>
<sect2 id="language.types.string.syntax">
- <title>Syntax</title>
+ <title>úçáéø</title>
<para>
- A string literal can be specified in three different
- ways.
+ îçøåæú éëåìä ìäëúá áùìåùä àåôðéí ùåðéí:
<itemizedlist>
<listitem>
<simpara>
- <link linkend="language.types.string.syntax.single">single quoted</link>
+ <link linkend="language.types.string.syntax.single">âøù</link>
</simpara>
</listitem>
<listitem>
<simpara>
- <link linkend="language.types.string.syntax.double">double quoted</link>
+ <link linkend="language.types.string.syntax.double">îøëàåú</link>
</simpara>
</listitem>
<listitem>
<simpara>
- <link linkend="language.types.string.syntax.heredoc">heredoc syntax</link>
+ <link linkend="language.types.string.syntax.heredoc">heredoc</link>
</simpara>
</listitem>
</itemizedlist>
</para>
<sect3 id="language.types.string.syntax.single">
- <title>Single quoted</title>
+ <title>âøù</title>
<para>
- The easiest way to specify a simple string is to
- enclose it in single quotes (the character <literal>'</literal>).
+ äãøê äôùåèä áéåúø ìöééï îçøåæú, äéà ìòèåó àåúä áâøù îùðé ÷öåúéä (äúå <literal>'</literal>).
</para>
<para>
To specify a literal single
quote, you will need to escape it with a backslash
(<literal>\</literal>), like in many other languages.
- If a backslash needs to occur before a single quote or at
+ If a backslash needs to occur before a single quote or at
the end of the string, you need to double it.
Note that if you try to escape any
other character, the backslash too will be printed! So
@@ -556,12 +527,12 @@
<simpara>
In PHP 3, a warning will
be issued at the <literal>E_NOTICE</literal> level when this
- happens.
+ happens.
</simpara>
</note>
<note>
<simpara>
- Unlike the two other syntaxes, variables will <emphasis>not</emphasis>
+ Unlike the two other syntaxes, variables will <emphasis>not</emphasis>
be expanded when they occur in single quoted strings.
</simpara>
</note>
@@ -669,7 +640,7 @@
only alphanumeric characters and underscores, and must start with
a non-digit character or underscore.
</simpara>
-
+
<warning>
<simpara>
It is very important to note that the line with the closing
@@ -681,7 +652,7 @@
</simpara>
<simpara>
Probably the nastiest gotcha is that there may also
- not be a carriage return (<literal>\r</literal>) at the end of
+ not be a carriage return (<literal>\r</literal>) at the end of
the line, only
a form feed, AKA newline (<literal>\n</literal>).
Since Microsoft Windows uses the sequence
@@ -705,7 +676,7 @@
above. Variables are expanded, but the same care must be taken
when expressing complex variables inside a here doc as with
strings.
- <example>
+ <example>
<title>Here doc string quoting example</title>
<programlisting role="php">
<![CDATA[
@@ -2066,4 +2037,4 @@
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
--->
+-->
\ No newline at end of file