cvs: phpdoc-ar /language types.xml
[email protected] ("Hafid Benhadria") Fri, 19 Sep 2003 23:27:53 -0000
| Newsgroups | php.doc.ar |
|---|---|
| Message-ID | <cvshafid1064014073@cvsserver> |
hafid Fri Sep 19 19:27:53 2003 EDT
Modified files:
/phpdoc-ar/language types.xml
Log:
6th Partial Translation. Still EN-1.123 compliant.
hafid-20030919192753.txt
(text/plain, 19.5 KB)
Index: phpdoc-ar/language/types.xml
diff -u phpdoc-ar/language/types.xml:1.5 phpdoc-ar/language/types.xml:1.6
--- phpdoc-ar/language/types.xml:1.5 Sat Sep 6 13:26:34 2003
+++ phpdoc-ar/language/types.xml Fri Sep 19 19:27:53 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-6"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<!-- EN-Revision: 1.123 Maintainer: hafid Status: working -->
<chapter id="language.types">
<title>ÇäÃæèÇÙ</title>
@@ -1244,122 +1244,121 @@
</para>
<warning>
<simpara>
- As of PHP 4.3.0, the index generation behaviour described
- above has changed. Now, if you append to an array in which
- the current maximum key is negative, then the next key
- created will be zero (<literal>0</literal>). Before, the new
- index would have been set to the largest existing key + 1,
- the same as positive indices are.
+ ÅÙÊÈÇÑÇ åæ PHP 4.3.0¬ ÊÚêÑ Óäèã ÊèäêÏ ÇäáçÑÓ ÇäåèÕèá
+ áê ÇäÃÙäé. ÇäÂæ¬ ÅÐÇ ÃÊååÊ ÅäÍÇâÇë äåÕáèáÉ êãèæ
+ åáÊÇÍçÇ ÇäÃâÕé ÇäÍÇäêñ ÓäÈêÇë áÅæñ ÇäåáÊÇÍ ÇäåïæòÔîà äÇÍâÇ
+ Óêãèæ ÕáÑ (<literal>0</literal>). âÈä Ðä㬠ãÇæ ÇäáçÑÓ ÇäÌÏêÏ
+ äÊÙêæ âêåÊç ÈÃãÈÑ åáÊÇÍ åèÌèÏ + 1¬
+ æáÓ ÇäÍÇä ÃêÖÇ ÈÇäæÓÈÉ ääáçÇÑÓ ÇäåèÌÈÉ.
</simpara>
</warning>
<para>
- Using &true; as a key will evaluate to <type>integer</type>
- <literal>1</literal> as key. Using &false; as a key will evaluate
- to <type>integer</type>
- <literal>0</literal> as key. Using
- <literal>NULL</literal> as a key will evaluate to the empty
- string. Using the empty string as key will create (or overwrite)
- a key with the empty string and its value; it is not the same as
- using empty brackets.
+ Åæñ ÇÓÊÎÏÇå &true; ãåáÊÇÍ Óêïâêñðå <type>ÇäÙÏÏ ÇäÕñÍêÍ</type>
+ <literal>1</literal> Ùäé Ãæñç åáÊÇÍ. Åæñ ÇÓÊÎÏÇå &false; ãåáÊÇÍ Óêïâêñðå
+ <type>ÇäÙÏÏ ÇäÕñÍêÍ</type>
+ <literal>0</literal> Ùäé Ãæñç åáÊÇÍ. Åæñ ÇÓÊÎÏÇå
+ <literal>NULL</literal> ãåáÊÇÍ Óêïâêñðå ÈÇÊÌÇç ÇäÓñäÓäÉ ÇäæñÕêñÉ ÇäáÇÑÚÉ.
+ Åæñ ÇÓÊÎÏÇå ÇäÓñÓäÓäÉ ÇäæñÕêñÉ ãåáÊÇÍ ÓêÄÏê Åäé ÅæÔÇÁ (Ãè ÓÍâ)
+ åáÊÇÍ ÈçÐç ÇäÓñäÓäÉ ÇäæñÕêñÉ èâêåÊçÇ» äêÓ ÇäÃåÑ æáÓç ÙæÏåÇ
+ ÊïÓòÊîÎòÏîå ÇäÃâèÇÓ ÇäáÇÑÚÉ.
</para>
<para>
- You cannot use arrays or objects as keys. Doing so will result in a
- warning: <literal>Illegal offset type</literal>.
+ äÇ êåãæã ÇÓÊÎÏÇå ÇäåÕáèáÇÊ Ãè ÇäãÇÆæÇÊ ãåáÇÊêÍ. ÇäâêÇå ÈåËä çÐÇ ÓêæÊÌ Ùæç
+ ÊÍÐêÑ: <literal>æèÙ ÅÒÇÍÉ äÇÔÑÙêñ - Illegal offset type</literal>.
</para>
</sect3>
<sect3 id="language.types.array.syntax.modifying">
- <title>Creating/modifying with square-bracket syntax</title>
+ <title>ÇäÅæÔÇÁ/ÇäÊÙÏêä ÈèÇÓ×É ÕêÚÉ ÇäâèÓ ÇäåÑÈÙ</title>
<para>
- You can also modify an existing array by explicitly setting
- values in it.
+ êåãæã ÃêÖÇ ÊÙÏêä åÕáèáÉ åÊèÇÌÏÉ ÃÕäÇ åæ ÎäÇä ÊÙêêæ
+ Çäâêå áêçÇ èÐäã ÈÔãä ÕÑêÍ.
</para>
<para>
- This is done by assigning values to the array while specifying the
- key in brackets. You can also omit the key, add an empty pair
- of brackets ("<literal>[]</literal>") to the variable name in that case.
+ êÊå çÐÇ åæ ÎäÇä ÊÙêêæ âêå ääåÕáèáÉ áê Íêæ Ãæ ÊÍÏêÏ
+ ÇäåáÊÇÍ êÊå áê ÃâèÇÓ. êåãæã ÃêÖÇ ÅÚáÇä ÇäåáÊÇͬ ÂÖᬠáê Êäã ÇäÍÇäɬ ÒèÌÇ áÇÑÚÇ åæ
+ ÇäÃâèÇÓ ("<literal>[]</literal>") Åäé ÅÓå ÇäåÊÚêÑ.
<synopsis>
$arr[<replaceable>key</replaceable>] = <replaceable>value</replaceable>;
$arr[] = <replaceable>value</replaceable>;
-// <replaceable>key</replaceable> may be an <type>integer</type> or <type>string</type>
-// <replaceable>value</replaceable> may be any value
+// <replaceable>key</replaceable> êåãæ Ãæ êãèæ <type>ÙÏÏÇ ÕÍêÍÇ</type> Ãè <type>ÓäÓäÉ æÕêñÉ</type>
+// <replaceable>value</replaceable> êåãæ Ãæ Êãèæ ÃêÉ âêåÉ
</synopsis>
- If <varname>$arr</varname> doesn't exist yet, it will be created.
- So this is also an alternative way to specify an array.
- To change a certain value, just assign a new value
- to an element specified with its key. If you want to
- remove a key/value pair, you need to <function>unset</function> it.
+ ÅÐÇ äå êãæ <varname>$arr</varname> åÊèÇÌÏÇ áÅæñç ÓêÊå ÅæÔÇÄç.
+ ÍÓæÇ¬ ÊÙÊÈÑ çÐç ÃêÖÇ ×ÑêâÉ ÈÏêäÉ äÊÍÏêÏ åÕáèáÉ.
+ äÊÚêêÑ âêåÉ åǬ áâ× âå ÈÊÙêêæ âêåÉ ÌÏêÏÉ
+ äÙæÕÑ åÇ åïÍîÏñîÏ ÈåáÊÇÍç. ÅÐÇ ãæÊ ÊÑÚÈ áê
+ ÅÒÇäÉ ÒèÌ åáÊÇÍ/âêåɬ áÅæñã ÊÍÊÇÌ äà <function>ÅÒÇäÉ ÊÙêêæà</function> àçÇ.
<informalexample>
<programlisting role="php"><![CDATA[
<?php
$arr = array(5 => 1, 12 => 2);
-$arr[] = 56; // This is the same as $arr[13] = 56;
- // at this point of the script
+$arr[] = 56; // çÐÇ æáÓ ÇäÔñêÁ åËä $arr[13] = 56;
+ // äçÐç Çäæñâ×É åæ ÇäÎÇ×è×
-$arr["x"] = 42; // This adds a new element to
- // the array with key "x"
+$arr["x"] = 42; // êÖêá çÐÇ ÙæÕÑÇ ÌÏêÏÇ Åäé
+ // ÇäåÕáèáÉ åÙ ÇäåáÊÇÍ "x"
-unset($arr[5]); // This removes the element from the array
+unset($arr[5]); // êÒêä çÐÇ ÇäÙæÕÑî åæ ÇäåÕáèáÉ
-unset($arr); // This deletes the whole array
+unset($arr); // êÍÐáï çÐÇ åÌåä ÇäåÕáèáÉ
?>
]]></programlisting>
</informalexample>
</para>
<note>
<para>
- As mentioned above, if you provide the brackets with no key
- specified, then the maximum of the existing integer indices is
- taken, and the new key will be that maximum value + 1 . If no
- integer indices exist yet, the key will be <literal>0</literal>
- (zero). If you specify a key that already has a value assigned
- to it, that value will be overwritten.
+ åËäåÇ ÊåÊ ÇäÅÔÇÑÉ Åäêç áê ÇäÃÙäé¬ ÅÐÇ äå ÊÒèñðÏ ÇäÃâèÇÓ ÈÃê åáÊÇÍ åïÍÏñîÏ
+ áÅæñç êÊå ÊÏÇèä ÇäÍÏ ÇäÃâÕé äáçÇÑÓ ÇäÙÏÏ ÇäÕñÍêÍ ÇäåÊèÇÌÏ
+ èÓêÊåËä ÇäåáÊÇÍ ÇäÌÏêÏ áê Êäã ÇäâêåÉ ÇäâÕèé + 1 . ÅÐÇ äå Êãæ çæÇã ÈÙÏ
+ ÃêÉ áçÇÑÓ äÙÏÏ ÕÍêͬ Óêãèæ ÇäåáÊÇÍ çè <literal>0</literal>
+ (ÕáÑ). ÅÐÇ ÍÏñîÏÊ åáÊÇÍÇ åÇ êÊèáÑ åÓÈâÇ Ùäé âêåÉ åïÙîêñîæîÉ
+ äÃÌäç¬ áÅæñ Êäã ÇäâêåÉ ÓÊïÓòÍâ.
</para>
<para>
<warning>
<simpara>
- As of PHP 4.3.0, the index generation behaviour described
- above has changed. Now, if you append to an array in which
- the current maximum key is negative, then the next key
- created will be zero (<literal>0</literal>). Before, the new
- index would have been set to the largest existing key + 1,
- the same as positive indices are.
+ ÅÙÊÈÇÑÇ åæ PHP 4.3.0¬ ÊÚêÑ Óäèã ÊèäêÏ ÇäáçÑÓ ÇäåèÕèá
+ áê ÇäÃÙäé. ÇäÂæ¬ ÅÐÇ ÃÊååÊ ÅäÍÇâÇë äåÕáèáÉ êãèæ
+ åáÊÇÍçÇ ÇäÃâÕé ÇäÍÇäêñ ÓäÈêÇë áÅæñ ÇäåáÊÇÍ ÇäåïæòÔîà äÇÍâÇ
+ Óêãèæ ÕáÑ (<literal>0</literal>). âÈä Ðä㬠ãÇæ ÇäáçÑÓ ÇäÌÏêÏ
+ äÊÙêæ âêåÊç ÈÃãÈÑ åáÊÇÍ åèÌèÏ + 1¬
+ æáÓ ÇäÍÇä ÃêÖÇ ÈÇäæÓÈÉ ääáçÇÑÓ ÇäåèÌÈÉ.
</simpara>
</warning>
</para>
<para>
- Note that the maximum integer key used for this <emphasis>need
- not currently exist in the array</emphasis>. It simply must
- have existed in the array at some time since the last time the
- array was re-indexed. The following example illustrates:
+ äÇÍØ Ãæ åáÊÇÍ ÇäÙÏÏ ÇäÕñÍêÍ ÇäÃâÕé ÇäåïÓòÊîÎòÏîå äçÐÇ <emphasis>äÇ êÍÊÇÌ
+ ÍÇäêÇ äÃæ êÊèÇÌÏ áê ÇäåÕáèáÉ</emphasis>. êÌÈ áâ×
+ Ãæñç ãÇæ åèÌèÏÇ áê ÇäåÕáèáÉ áê èâÊ åÇ åæÐ ÂÎÑ åÑÉ
+ ÊåÊ ÎäÇäç ÅÙÇÏÉ áçÑÓÉ ÇäåÕáèáÉ. ÇäåËÇä ÇäÊñÇäêñ ääÔçÇÏÉ:
</para>
<informalexample>
<programlisting role="php"><![CDATA[
<?php
-// Create a simple array.
+// êïæòÔðÆ åÕáèáÉ ÈÓê×É.
$array = array(1, 2, 3, 4, 5);
print_r($array);
-// Now delete every item, but leave the array itself intact:
+// ÇäÂæ¬ ÇÍÐá ãä ÈæÏ äãæ ÇÊÑã ÇäåÕáèáÉ åæ Ïèæ åÓÇÓ ÈÐÇÊçÇ:
foreach ($array as $i => $value) {
unset($array[$i]);
}
print_r($array);
-// Append an item (note that the new key is 5, instead of 0 as you
-// might expect).
+// ÃÒÍ ÈæÏÇ åÇ (äÇÍØ Ãæñ ÇäåáÊÇÍ ÇäÌÏêÏ çè 5 ÈÏäÇ åæ 0 åËäåÇ
+// êåãæ Ãæ ÊÊèâÙ).
$array[] = 6;
print_r($array);
-// Re-index:
+// ÃÙÏ ÇäáçÑÓÉ:
$array = array_values($array);
$array[] = 7;
print_r($array);
-
?>
]]></programlisting>
<para>
- The above example would produce the following output:
+ ÇäåËÇä ÇäÐê áê ÇäÃÙäé ÓêÄÏê Åäé ÇäåïÎÑÌ ÇäÊñÇäêñ:
<screen><![CDATA[
Array
(
@@ -1389,50 +1388,50 @@
</sect2>
<!-- end syntax -->
<sect2 id="language.types.array.useful-funcs">
- <title>Useful functions</title>
+ <title>ÏèÇä åáêÏÉ</title>
<para>
- There are quite a few useful functions for working with arrays.
- See the <link linkend="ref.array">array functions</link> section.
+ çæÇã ÇäÙÏêÏ åæ ÇäÏñèÇä ÇäåáêÏÉ ääÙåä åÙ ÇäåÕáèáÇÊ.
+ ÊåÙñîæ áê áÕä <link linkend="ref.array">ÏèÇä ÇäåÕáèáÇÊ</link>.
</para>
<note>
<para>
- The <function>unset</function> function allows unsetting keys of an
- array. Be aware that the array will NOT be reindexed. If you only
- use "usual integer indices" (starting from zero, increasing by one),
- you can achive the reindex effect by using <function>array_values</function>.
+ ÊÓåÍ ÏÇäÉ <function>unset</function> ÈÅÒÇäÉ ÊÙêêæ ÇäåáÇÊêÍ ÇäÎÇÕÉ
+ ÈåÕáèáÉ. ÇÍÐÑ Ãæ ÇäåÕáèáÉ äæ ÊïÙÇÏ áçÑÓÊçÇ. ÅÐÇ ãæÊ
+ ÊÓÊÎÏå "áçÇÑÓ ÇäÃÙÏÇÏ ÇäÕñÍêÍÉ ÇäåÙÊÇÏÉ" (ÊÈÊÏÃ åæ ÇäÕñáѬ ÊÊÒÇêÏ ÈÇäÂÍÇÏ) áâ׬
+ áêåãæã ÅÊåÇå ÊÃËêÑ ÅÙÇÏÉ ÇäáçÑÓÉ ÈèÇÓ×É <function>array_values</function>.
<informalexample>
<programlisting role="php"><![CDATA[
<?php
$a = array(1 => 'one', 2 => 'two', 3 => 'three');
unset($a[2]);
-/* will produce an array that would have been defined as
+/* ÓêÄÏê Åäé ÅæÊÇÌ åÕáèáÉ ÓÊïÙÑñîá ãåÇ êäê
$a = array(1 => 'one', 3 => 'three');
- and NOT
+ èäêÓ
$a = array(1 => 'one', 2 =>'three');
*/
$b = array_values($a);
-// Now b is array(1 => 'one', 2 =>'three')
+// ÇäÂæ b ÃÕÈÍ ÇäåÕáèáÉ array(1 => 'one', 2 =>'three')
?>
]]></programlisting>
</informalexample>
</para>
</note>
<para>
- The <link linkend="control-structures.foreach">foreach</link>
- control structure exists specifically for arrays. It
- provides an easy way to traverse an array.
+ ÊèÌÏ ÈæêÉ ÇäÊÍãå <link linkend="control-structures.foreach">foreach</link>
+ ÎÕêÕÇë åæ ÃÌä ÇäåÕáèáÇÊ. ÊÒèÏæÇ
+ È×ÑêâÉ ÓçäÉ äæîÌïèÈî åÕáèáÉë åÇ.
</para>
</sect2>
<sect2 id="language.types.array.donts">
- <title>Array do's and don'ts</title>
+ <title>åÇ Êâèå Èç èåÇ äÇ Êâèå Èç ÇäåÕáèáÉ</title>
<sect3 id="language.types.array.foo-bar">
- <title>Why is <literal>$foo[bar]</literal> wrong?</title>
+ <title>äåÇÐÇ êÙÊÈÑ <literal>$foo[bar]</literal> ÎÇׯÇë¿</title>
<para>
- You should always use quotes around a string literal
- array index. For example, use $foo['bar'] and not
- $foo[bar]. But why is $foo[bar] wrong? You might have seen the
- following syntax in old scripts:
+ Ùäêã ÏèåÇë Ãæ ÊÓÊÎÏå ÙäÇåÇÊ ÊæÕêÕ Íèä
+ áçÑÓ åÕáèáÉ ÎÇÕÉ ÈÍÑáêÉ ÓäÓäÉ æÕêñÉ. Ùäé ÓÈêä ÇäåËÇä¬ ÇÓÊÎÏå $foo['bar'] èäêÓ
+ $foo[bar]. äãæ äåÇÐÇ êÙÊÈÑ $foo[bar] ÎÇׯÇë¿ êåãæ Ãæñã ÑÃêÊ
+ ÇäÕñêÚÉ ÇäÊñÇäêñÉ áê ÇäÎèÇ×ê× ÇäâÏêåÉ:
<informalexample>
<programlisting role="php"><![CDATA[
<?php
@@ -1442,22 +1441,22 @@
?>
]]></programlisting>
</informalexample>
- This is wrong, but it works. Then, why is it wrong? The reason
- is that this code has an undefined constant (bar) rather than a
- string ('bar' - notice the quotes), and PHP may in future define
- constants which, unfortunately for your code, have the same
- name. It works because PHP automatically converts a
- <emphasis>bare string</emphasis> (an unquoted string which does
- not correspond to any known symbol) into a string which contains
- the bare string. For instance, if there is no defined constant
- named <constant>bar</constant>, then PHP will substitute in the
- string <literal>'bar'</literal> and use that.
+ êÙÊÈÑ çÐÇ ÎÇׯÇë äãæñç êÙåä. ÅÐæ: äåÇÐÇ çè ÎÇׯ¿ ÇäÓÈÈ êÙèÏ
+ äÃæñ çÐç ÇäÔñêáÑÉ ÊÊèáÑ Ùäé ËÇÈÊ ÚêÑ åïÙîÑñîá (bar) ÈÏäÇ åæ
+ ÓäÓäÉ æÕêñÉ ('bar' - ÅæÊÈç Åäé ÙäÇåÇÊ ÇäÊñæÕêÕ) èáê ÇäåÓÊâÈä ÑÈåÇ êÕÈÍ ÈÅåãÇæ PHP ÊÙÑêá
+ ÇäËèÇÈÊ ÇäÊñê¬ èáê ÚêÑ ÕÇäÍ ÔêáÑÊ㬠äÏêçÇ æáÓ
+ ÇäÅÓå. çè êÙåä äÃæñ PHP êïÍîèñðä ÂäêÇë
+ <emphasis>ÇäÓñäÓäÉ ÇäæñÕêñÉ ÇäåáÑÚÉ (bare string)</emphasis> (ÓäÓäÉ æÕêñÉ ÚêÑ åÍÇ×É ÈÙäÇåÇÊ ÊæÕêÕ
+ äÇ ÊâÇÈä Ãê ÑåÒ åÙÑèá) Öåæ ÓäÓäÉ æÕêñÉ ÊÍÊèê
+ ÇäÓñäÓäÉ ÇäæñÕêñÉ ÇäåáÑÚÉ. Ùäé ÓÈêä ÇäåËÇä¬ ÅÐÇ äå êãæ çæÇã ËÇÈÊÇ åïÙîÑñîáÇë
+ êïÓåé <constant>bar</constant>¬ áÅæñ PHP ÍêæçÇ ÓêîÓòÊîÈòÏðä áê
+ ÇäÓñäÓäÉ ÇäæñÕêñÉ <literal>'bar'</literal> èÓêÓÊÎÏå Êäã.
</para>
<note>
<simpara>
- This does not mean to <emphasis>always</emphasis> quote the
- key. You do not want to quote keys which are <link linkend="language.constants">constants</link> or <link linkend="language.variables">variables</link>, as this will
- prevent PHP from interpreting them.
+ äÇ êÙæê çÐÇ Ãæ ÊÍê× ÇäáåÊÇÍë <emphasis>ÏèåÇë</emphasis> ÈÙäÇåÇÊ ÊæÕêÕ.
+ Åæñã äÇ ÊÑÚÈ áê ÅÍÇ×É ÇäåáÇÊêÍ ÇäÊê çê <link linkend="language.constants">ËèÇÈÊ</link> Ãè <link linkend="language.variables">åÊÚêÑÇÊ</link> ÈÙäÇåÇÊ ÊæÕêÕ ÈÇÙÊÈÇÑ Ãæñ çÐÇ ÓêÄÏê
+ Åäé ÌÙä PHP ÊÊáÇÏé ÊáÓêÑçÇ.
</simpara>
<informalexample>
<programlisting role="php"><![CDATA[
@@ -1465,7 +1464,7 @@
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', false);
-// Simple array:
+// åÕáèáÉ ÈÓê×É:
$array = array(1, 2);
$count = count($array);
for ($i = 0; $i < $count; $i++) {
@@ -1479,7 +1478,7 @@
]]></programlisting>
</informalexample>
<para>
- The output from the above is:
+ Åæñ åïÎÑîÌ åÇ áê ÇäÃÙäé çè:
<screen><![CDATA[
Checking 0:
Notice: Undefined index: $i in /path/to/script.html on line 9
@@ -1500,41 +1499,41 @@
</para>
</note>
<para>
- More examples to demonstrate this fact:
+ åÒêÏ åæ ÇäÃåËäÉ äÊèÖêÍ çÐÇ ÇäèÇâÙ:
<informalexample>
<programlisting role="php"><![CDATA[
<?php
-// Let's show all errors
+// äæïØçðÑ ãÇáÉ ÇäÃÎ×ÇÁ
error_reporting(E_ALL);
$arr = array('fruit' => 'apple', 'veggie' => 'carrot');
-// Correct
+// ÇäÕñÍêÍ
print $arr['fruit']; // apple
print $arr['veggie']; // carrot
-// Incorrect. This works but also throws a PHP error of
-// level E_NOTICE because of an undefined constant named fruit
+// ÚêÑ ÕÍêÍ. êÙåä çÐÇ äãæñç êïÕòÏðÑ Î×Ç PHP åæ
+// åÓÊèé E_NOTICE ÈÓÈÈ ËÇÈÊ ÚêÑ åïÙÑñîá êïÏòÙé fruit
//
-// Notice: Use of undefined constant fruit - assumed 'fruit' in...
+// ÊæÈêç: ÇÓÊÎÏÇå ËÇÈÊ ÚêÑ åïÙÑñîá fruit - êïáÊÑÖ èÌèÏ 'fruit' áê...
print $arr[fruit]; // apple
-// Let's define a constant to demonstrate what's going on. We
-// will assign value 'veggie' to a constant named fruit.
+// äæâå ÈÊÙÑêá ËÇÈÊ äÊèÖêÍ åÇ êÌÑê.
+// Óæâèå ÈÊÙêêæ ÇäâêåÉ 'veggie' ääËÇÈÊ ÇäåïÓåé fruit.
define('fruit', 'veggie');
-// Notice the difference now
+// ÇæÊÈç ääáÑâ ÇäÂæ
print $arr['fruit']; // apple
print $arr[fruit]; // carrot
-// The following is okay as it's inside a string. Constants are not
-// looked for within strings so no E_NOTICE error here
-print "Hello $arr[fruit]"; // Hello apple
-
-// With one exception, braces surrounding arrays within strings
-// allows constants to be looked for
-print "Hello {$arr[fruit]}"; // Hello carrot
-print "Hello {$arr['fruit']}"; // Hello apple
+// åÇ êäê Óäêå ÈåÇ Ãæñç ÏÇÎä ÓäÓäÉ æÕêñÉ. äÇ êïÈÍË Ùæ ÇäËèÇÈÊ
+// ÏÇÎä ÇäÓñäÇÓä ÇäæñÕêñÉ äÐäã äêÓ çæÇã åæ Î×à E_NOTICE çæÇ
+print "ÃçäÇ $arr[fruit]"; // ÃçäÇ apple
+
+// åÙ ÇÓÊËæÇÁ èÇÍϬ áÅæñ ÇäÍÇÖæÊêæ ÇääñÊêæ ÊÍê×Çæ ÈÇäåÕáèáÇÊ ÏÇÎä ÇäÓñäÇÓä ÇäæñÕêñÉ
+// ÊÓåÍÇæ ääËèÇÈÊ ÈÃæ êïÈòÍîË ÙæçÇ
+print "ÃçäÇ {$arr[fruit]}"; // ÃçäÇ carrot
+print "ÃçäÇ {$arr['fruit']}"; // ÃçäÇ apple
// This will not work, results in a parse error such as:
// Parse error: parse error, expecting T_STRING' or T_VARIABLE' or T_NUM_STRING'
@@ -1656,6 +1655,7 @@
<informalexample>
<programlisting role="php"><![CDATA[
<?php
+
// this
$a = array( 'color' => 'red',
'taste' => 'sweet',