cvs: phpdoc /kr/language operators.xml
| From: | WonHee Hwang | Date: | Tue, 09 Jan 2001 09:23:36 +0000 |
| Subject: | cvs: phpdoc /kr/language operators.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969333501@lists.php.net to get a copy of this message | ||
regina Tue Jan 9 01:23:36 2001 EDT
Added files:
/phpdoc/kr/language operators.xml
Log:
Index: phpdoc/kr/language/operators.xml +++ phpdoc/kr/language/operators.xml <chapter id="language.operators"> <title>ì°ì°ì (Operators)</title> <simpara/> <sect1 id="language.operators.arithmetic"> <title>ì°ì ì°ì°ì (Arithmetic Operators)</title> <simpara> íêµìì ë°°ì´ ì°ì ì°ì°(ê°ê°ì¹ì )ì 기ìµíëê°? ì´ ì°ì ì°ì°ìë ê·¸ê²ì²ë¼ ëìíë¤. </simpara> <table> <title>Arithmetic Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Result</entry> </row> </thead> <tbody> <row> <entry>$a + $b</entry> <entry>ë§ì (Addition)</entry> <entry>$aì $bì í©.</entry> </row> <row> <entry>$a - $b</entry> <entry>ëºì (Subtraction)</entry> <entry>$aìì $b를 ëº ê°.</entry> </row> <row> <entry>$a * $b</entry> <entry>ê³±ì (Multiplication)</entry> <entry>$aì $bì ê³±.</entry> </row> <row> <entry>$a / $b</entry> <entry>ëëì (Division)</entry> <entry>$aìì $b를 ëë ê°(í¹ ì 몫).</entry> </row> <row> <entry>$a % $b</entry> <entry>ë머ì§(Modulus)</entry> <entry>$aìì $b를 ëë ë머ì§.</entry> </row> </tbody> </tgroup> </table> <simpara> The division operator ("/") returns an integer value (the result of an integer division) if the two operands are integers (or strings that get converted to integers) and the quotient is an integer. If either operand is a floating-point value, or the operation results in a non-integer value, a floating-point value is returned. </simpara> </sect1> <sect1 id="language.operators.assignment"> <title>ëì ì°ì°ì (Assignment Operators)</title> <simpara> 기본 ëì ì°ì°ìë "="ì´ë¤. ì´ ì°ì°ì를 ì²ì ë³´ìì ëë "ê°ë¤"ë¼ë ì°ì°ìë¡ ìê°í기 ì½ì§ë§ ì í ìëë¤. ì´ê²ì ì미ë ì¤ë¥¸ìª½ì ííìì ê³ì°íì¬ ê·¸ ê°ì ì¼ìª½ì ìë í¼ì°ì°ìì ê°ì¼ë¡ ì¤ì íë¤ë ì미ì´ë¤. (ì´ê²ì "gets set to"ë¼ê³ íë¤.) </simpara> <para> ëì ì°ì°ìì ê°ì ì¼ìª½ì¼ë¡ ëì ë ê°ì´ë¤. ì¦, "$a = 3"ì ê°ì 3ì´ ëë¤. ì´ê²ì ì¬ë¬ë¶ìê² ì½ê°ì í¸ë¦ì´ ê°ë¥íëë¡íë¤. <informalexample> <programlisting role="php"> $a = ($b = 4) + 5; // $aë 9, $bë 4ì ê°ì ê°ì§ë¤. </programlisting> </informalexample> </para> <para> 기본ì ì¸ ëì ì°ì°ì ì¸ì 모ë Bit ë¨ì ì°ì°ì, ì°ì ì°ì°ìì ê²°í©í ë³µí© ëì ì°ì°ìë ìë¤. ê²°í©ë ì°ì°ìë ííììì í´ë¹ ì°ì°ì¼ë¡ ì¬ì©ëê³ , ê·¸ ì°ì° ê°ì ì¼ìª½ì ìë í¼ì°ì°ìì ëì íë¤. ì를 ë¤ì´ : <informalexample> <programlisting role="php"> $a = 3; $a += 5; // $aë 8ì´ë¤. $a = $a + 5; ì ëì¼íë¤. $b = "Hello "; $b .= "There!"; // $bë "Hello There!"ê° ëë¤. $b = $b . "There!";ì ê°ë¤. </programlisting> </informalexample> </para> <para> Note that the assignment copies the original variable to the new one (assignment by value), so changes to one will not affect the other. This may also have relevance if you need to copy something like a large array inside a tight loop. PHP 4 supports assignment by reference, using the <computeroutput>$var = &$othervar;</computeroutput> syntax, but this is not possible in PHP 3. 'Assignment by reference' means that both variables end up pointing at the same data, and nothing is copied anywhere. To learn more about references, please read <link linkend="language.references">References explained</link>. </para> </sect1> <sect1 id="language.operators.bitwise"> <title>Bit ë¨ì ì°ì°ì (Bitwise Operators)</title> <simpara> ë¹í¸ ë¨ì ì°ì°ìë ì ìì ê°ë³ ë¹í¸ì ê°ì on, off í ì ìë¤. </simpara> <table> <title>Bitwise Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Result</entry> </row> </thead> <tbody> <row> <entry>$a & $b</entry> <entry>And</entry> <entry>$aì $bê° ëª¨ë 1ì¸ ë¹í¸ë§ 1ì´ ëë¤.</entry> </row> <row> <entry>$a | $b</entry> <entry>Or</entry> <entry>$aì $bì¤ íëë¼ë 1ì¸ ë¹í¸ë 1ì´ ëë¤.</entry> </row> <row> <entry>$a ^ $b</entry> <entry>Xor</entry> <entry>$aì $bì¤ íëë 1ì´ê³ , ë¤ë¥¸ íëë 0ì¸ ë¹í¸ë§ 1ì´ëê³ , ë머ì§ë 0ì´ ëë¤.</entry> </row> <row> <entry>~ $a</entry> <entry>Not</entry> <entry>$aìì 1ì¸ ë¹í¸ë 0ì¼ë¡, 0ì¸ ë¹í¸ë 1ë¡ ëë¤.</entry> </row> <row> <entry>$a << $b</entry> <entry>Shift left</entry> <entry>$aì ë¹í¸ë¤ì $b step ë§í¼ ì¼ìª½ì¼ë¡ shift íë¤. (í stepì 2를 í ë² ê³±íë ë§í¼ì í¨ê³¼ê° ìë¤.)</entry> </row> <row> <entry>$a >> $b</entry> <entry>Shift right</entry> <entry>$aì ë¹í¸ë¤ì $b step ë§í¼ ì¤ë¥¸ì¼ë¡ shift íë¤. (í stepì 2를 í ë² ëëë ë§í¼ì í¨ê³¼ê° ìë¤.)</entry> </row> </tbody> </tgroup> </table> </sect1> <sect1 id="language.operators.comparison"> <title>ë¹êµ ì°ì°ì (Comparison Operators)</title> <simpara> ë¹êµ ì°ì°ìë ì´ë¦ìì ì ì ìë¯ì´ ë ê°ì ê°ì ë¹êµíë ì°ì°ìì´ë¤. </simpara> <table> <title>Comparison Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Result</entry> </row> </thead> <tbody> <row> <entry>$a == $b</entry> <entry>Equal</entry> <entry>$aì $bê° ê°ì¼ë©´ true.</entry> </row> <row> <entry>$a === $b</entry> <entry>Identical</entry> <entry>$aì $bê° ê°ì¼ë©´ true. $aì $bì typeê¹ì§ ëì¼í´ì¼ íë¤. (PHP4 only)</entry> </row> <row> <entry>$a != $b</entry> <entry>Not equal</entry> <entry>$aì $bê° ë¤ë¥´ë©´ true.</entry> </row> <row> <entry>$a !== $b</entry> <entry>Not identical</entry> <entry>$aì $bê° ë¤ë¥´ë©´ ê°ì¼ë©´ true. $aì $bì typeë§ ë¬ë¼ë true. (PHP4 only) True if $a is not equal to $b, or they are not of the same type. (PHP 4 only) </entry> </row> <row> <entry>$a < $b</entry> <entry>Less than</entry> <entry>$aê° $bë³´ë¤ ìì¼ë©´ true.</entry> </row> <row> <entry>$a > $b</entry> <entry>Greater than</entry> <entry>$aê° $bë³´ë¤ í¬ë©´ true.</entry> </row> <row> <entry>$a <= $b</entry> <entry>Less than or equal to </entry> <entry>$aê° $bë³´ë¤ ìê±°ë ê°ì¼ë©´ true.</entry> </row> <row> <entry>$a >= $b</entry> <entry>Greater than or equal to </entry> <entry>$aê° $bë³´ë¤ í¬ê±°ë ê°ì¼ë©´ true.</entry> </row> </tbody> </tgroup> </table> <para> ë ë¤ë¥¸ ì¡°ê±´ ì°ì°ìë¡ Cë ë¤ë¥¸ ì¸ì´ì ìë "?:" ì°ì°ìê° ìë¤. <informalexample> <programlisting> (expr1) ? (expr2) : (expr3); </programlisting> </informalexample> ì´ ííìì <replaceable>expr1</replaceable>ì ê²°ê³¼ê° ì°¸ì´ë©´ <replaceable>expr2</replaceable>를 ë°ííê³ , ê±°ì§ì´ë©´ <replaceable>expr3</replaceable>를 ë°ííë¤. </para> </sect1> <sect1 id="language.operators.errorcontrol"> <title>ì¤ë¥ ì ì´ ì°ì°ì (Error control Operators)</title> <simpara> PHPë @(at íì)ì´ë¼ë í ê°ì ì¤ë¥ ì ì´ ì°ì°ì를 ì ê³µíë¤. PHPì ííì ìì ì´ íìê° ë¶ì¼ë©´, í´ë¹ ííììì ë°ìí 모ë ìë¬ ë©ìì§ê° 무ìëë¤. </simpara> <simpara> ë§ì½ <link linkend="ini.track-errors">track_errors</link> 기ë¥ì´ íì±í ëì´ ìë¤ë©´, í´ë¹ ííììì ë°ìí 모ë ìë¬ ë©ìì§ë $php_errormsg ë¼ë ì ì ë³ìì ì ì¥ë ê²ì´ë¤. ì´ ë³ìì ê°ì ë§¤ë² ìë¬ê° ë°ìí ëë§ë¤ ìë¡ ì¤ì ëë¤. ë°ë¼ì ë§ì½ ì¬ë¬ë¶ì´ ì´ ë³ì를 ì¬ì©íë ¤ë©´ ìë¬ê° ë°ìí ì§íì ìµëí 빨리 ì¬ì©íì¬ì¼ íë¤. </simpara> <para> <informalexample> <programlisting role="php"> <?php /* Intentional SQL error (extra quote): */ $res = @mysql_query ("select name, code from 'namelist") or die ("Query failed: error was '$php_errormsg'"); ?> </programlisting> </informalexample> </para> <simpara> See also <function>error_reporting</function>. </simpara> <warning> <para> Currently the "@" error-control operator prefix will even disable error reporting for critical errors that will terminate script execution. Among other things, this means that if you use "@" to suppress errors from a certain function and either it isn't available or has been mistyped, the script will die right there with no indication as to why. </para> </warning> </sect1> <sect1 id="language.operators.execution"> <title>ì¤í ì°ì°ì (Execution Operators)</title> <para> PHPë í ê°ì ì¤í ì°ì°ì를 ì ê³µíë¤. (``) ì¼ë° ìì ë°ì´íê° ìëì 주ìíì! PHPë ì´ ì¬ì´ì ìë ëª ë ¹ì shell ëª ë ¹ì´ë¡ ì¤ííê³ ê·¸ 결과를 ë°ííë¤. (ì¤í 결과를 ë¨ìí ì¶ë ¥íë ê²ì´ ìëê³ , ë³ííì¬ ë³ìì ì ì¥í ìë ìë¤.) <informalexample> <programlisting role="php"> $output = `ls -al`; echo "<pre>$output</pre>"; </programlisting> </informalexample> </para> <para> See also <function>system</function>, <function>passthru</function>, <function>exec</function>, <function>popen</function>, and <function>escapeshellcmd</function>. </para> </sect1> <sect1 id="language.operators.increment"> <title>ì¦ê°/ê°ì ì°ì°ì (Incrementing/Decrementing Operators)</title> <para> PHPë C ííì ì, ë¤ì ë¶ë ì¦ê°ë ê°ì ì°ì°ì를 ì ê³µíë¤. </para> <table> <title>Increment/decrement Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Effect</entry> </row> </thead> <tbody> <row> <entry>++$a</entry> <entry>Pre-increment</entry> <entry>$a 를 1 ì¦ê°ìí¨ í, $a를 ë°ííë¤</entry> </row> <row> <entry>$a++</entry> <entry>Post-increment</entry> <entry>$a를 ë°íí í,$a 를 1 ì¦ê°ìí¨ë¤.</entry> </row> <row> <entry>--$a</entry> <entry>Pre-decrement</entry> <entry>$a 를 1 ê°ììí¨ í, $a를 ë°ííë¤.</entry> </row> <row> <entry>$a--</entry> <entry>Post-decrement</entry> <entry>$a를 ë°íí í,$a 를 1 ê°ììí¨ë¤.</entry> </row> </tbody> </tgroup> </table> <para> $a를 ë°íí í,$a 를 1 ì¦ê°ìí¨ë¤.: <informalexample> <programlisting role="php"> <?php echo "<h3>Postincrement</h3>"; $a = 5; echo "Should be 5: " . $a++ . "<br>\n"; echo "Should be 6: " . $a . "<br>\n"; echo "<h3>Preincrement</h3>"; $a = 5; echo "Should be 6: " . ++$a . "<br>\n"; echo "Should be 6: " . $a . "<br>\n"; echo "<h3>Postdecrement</h3>"; $a = 5; echo "Should be 5: " . $a-- . "<br>\n"; echo "Should be 4: " . $a . "<br>\n"; echo "<h3>Predecrement</h3>"; $a = 5; echo "Should be 4: " . --$a . "<br>\n"; echo "Should be 4: " . $a . "<br>\n"; ?> </programlisting> </informalexample> </para> </sect1> <sect1 id="language.operators.logical"> <title>Logical Operators</title> <table> <title>Logical Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Result</entry> </row> </thead> <tbody> <row> <entry>$a and $b</entry> <entry>And</entry> <entry>$aì $bê° ëª¨ë true ì´ë©´ true.</entry> </row> <row> <entry>$a or $b</entry> <entry>Or</entry> <entry>$aì $bì¤ íëë¼ë trueì´ë©´ true.</entry> </row> <row> <entry>$a xor $b</entry> <entry>Xor</entry> <entry>$aì $bì¤ íëë§ trueì´ì´ì¼ true</entry> </row> <row> <entry>! $a</entry> <entry>Not</entry> <entry>$aê° trueê° ìëë©´ true</entry> </row> <row> <entry>$a && $b</entry> <entry>And</entry> <entry>$aì $bê° ëª¨ë true ì´ë©´ true.</entry> </row> <row> <entry>$a || $b</entry> <entry>Or</entry> <entry>$aì $bì¤ íëë¼ë trueì´ë©´ true.</entry> </row> </tbody> </tgroup> </table> <simpara> "and"ì "or" ì°ì°ìê° ëê°ì§ì ë¤ë¥¸ íí를 ê°ì§ê³ ìë ì´ì ë ì´ ì°ì°ìë¤ì´ ìë¡ ë¤ë¥¸ ì°ì ìì를 ê°ì§ê³ ì기 ë문ì´ë¤. (ìë <link linkend="language.operators.precedence">Operator Precedence</link>를 ë³´ë¼.) </simpara> </sect1> <sect1 id="language.operators.precedence"> <title>ì°ì°ì ì°ì ìì (Operator Precedence)</title> <para> ì°ì°ìë¤ì ì°ì ììë ë ê°ì ííìì¤ ì´ëê²ì´ ë ë¨ë¨í ë¬¶ì¬ ìëê°ë¥¼ ëª ê¸°íë¤. ì를ë¤ì´ <literal>1 + 5 * 3</literal>ì <literal>16</literal>ì ë°ííì§ <literal>18</literal>ì ë°ííì§ ìëë¤. ìëíë©´ ê³±í기("*")ì°ì°ìê° ëí기("+")ì°ì°ìë³´ë¤ ì°ì ììê° ë기 ë문ì´ë¤. íìíë©´ ê´í¸ë¥¼ ì¬ì©íì¬ ì°ì ìì를 ê°ì ì ì¼ë¡ ì¤ì í ì ìë¤. ì를ë¤ì´ <literal>(1 + 5) * 3</literal>ì ê²°ê³¼ë <literal>18</literal>ì´ ëë¤. </para> <para> ë¤ì íë ì°ì°ìì ì°ì ìì를 ëíë¸ë¤ ê°ì¥ ìì ìë ì°ì°ìì ì°ì ììê° ê°ì¥ ë®ë¤. <table> <title>Operator Precedence</title> <tgroup cols="2"> <thead> <row> <entry>Associativity</entry> <entry>Operators</entry> </row> </thead> <tbody> <row> <entry>left</entry> <entry>,</entry> </row> <row> <entry>left</entry> <entry>or</entry> </row> <row> <entry>left</entry> <entry>xor</entry> </row> <row> <entry>left</entry> <entry>and</entry> </row> <row> <entry>right</entry> <entry>print</entry> </row> <row> <entry>left</entry> <entry> = += -= *= /= .= %= &= |= ^= ~= <<= >>= </entry> </row> <row> <entry>left</entry> <entry>? :</entry> </row> <row> <entry>left</entry> <entry>||</entry> </row> <row> <entry>left</entry> <entry>&&</entry> </row> <row> <entry>left</entry> <entry>|</entry> </row> <row> <entry>left</entry> <entry>^</entry> </row> <row> <entry>left</entry> <entry>&</entry> </row> <row> <entry>non-associative</entry> <entry>== != === !==</entry> </row> <row> <entry>non-associative</entry> <entry>< <= > >=</entry> </row> <row> <entry>left</entry> <entry><< >></entry> </row> <row> <entry>left</entry> <entry>+ - .</entry> </row> <row> <entry>left</entry> <entry>* / %</entry> </row> <row> <entry>right</entry> <entry>! ~ ++ -- (int) (double) (string) (array) (object) @</entry> </row> <row> <entry>right</entry> <entry>[</entry> </row> <row> <entry>non-associative</entry> <entry>new</entry> </row> </tbody> </tgroup> </table> </para> </sect1> <sect1 id="language.operators.string"> <title>문ìì´ ì°ì°ì (String Operators)</title> <simpara> 문ìì´ ì°ì°ìë ëê°ê° ìë¤. 첫 ë²ì§¸ë ì¼ìª½ê³¼ ì¤ë¥¸ìª½ì ë 문ìì´ì ì°ê²°íë ì°ê²°(concatenation) ì°ì°ì (".") ê° ìë¤. ë ë²ì§¸ë ì°ê²° ëì ì°ì°ì (".=") ê° ìë¤. ì´ì ëí´ìë <link linkend="language.operators.assignment">ëì ì°ì°ì(Assugnment Operator)</link> ë¶ë¶ì ì½ì´ë³´ì. </simpara> <para> <informalexample> <programlisting role="php"> $a = "Hello "; $b = $a . "World!"; // now $b contains "Hello World!" $a = "Hello "; $a .= "World!"; // now $a contains "Hello World!" </programlisting> </informalexample> </para> </sect1> </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 sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: -->
Index: phpdoc/kr/language/operators.xml +++ phpdoc/kr/language/operators.xml <chapter id="language.operators"> <title>ì°ì°ì (Operators)</title> <simpara/> <sect1 id="language.operators.arithmetic"> <title>ì°ì ì°ì°ì (Arithmetic Operators)</title> <simpara> íêµìì ë°°ì´ ì°ì ì°ì°(ê°ê°ì¹ì )ì 기ìµíëê°? ì´ ì°ì ì°ì°ìë ê·¸ê²ì²ë¼ ëìíë¤. </simpara> <table> <title>Arithmetic Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Result</entry> </row> </thead> <tbody> <row> <entry>$a + $b</entry> <entry>ë§ì (Addition)</entry> <entry>$aì $bì í©.</entry> </row> <row> <entry>$a - $b</entry> <entry>ëºì (Subtraction)</entry> <entry>$aìì $b를 ëº ê°.</entry> </row> <row> <entry>$a * $b</entry> <entry>ê³±ì (Multiplication)</entry> <entry>$aì $bì ê³±.</entry> </row> <row> <entry>$a / $b</entry> <entry>ëëì (Division)</entry> <entry>$aìì $b를 ëë ê°(í¹ ì 몫).</entry> </row> <row> <entry>$a % $b</entry> <entry>ë머ì§(Modulus)</entry> <entry>$aìì $b를 ëë ë머ì§.</entry> </row> </tbody> </tgroup> </table> <simpara> The division operator ("/") returns an integer value (the result of an integer division) if the two operands are integers (or strings that get converted to integers) and the quotient is an integer. If either operand is a floating-point value, or the operation results in a non-integer value, a floating-point value is returned. </simpara> </sect1> <sect1 id="language.operators.assignment"> <title>ëì ì°ì°ì (Assignment Operators)</title> <simpara> 기본 ëì ì°ì°ìë "="ì´ë¤. ì´ ì°ì°ì를 ì²ì ë³´ìì ëë "ê°ë¤"ë¼ë ì°ì°ìë¡ ìê°í기 ì½ì§ë§ ì í ìëë¤. ì´ê²ì ì미ë ì¤ë¥¸ìª½ì ííìì ê³ì°íì¬ ê·¸ ê°ì ì¼ìª½ì ìë í¼ì°ì°ìì ê°ì¼ë¡ ì¤ì íë¤ë ì미ì´ë¤. (ì´ê²ì "gets set to"ë¼ê³ íë¤.) </simpara> <para> ëì ì°ì°ìì ê°ì ì¼ìª½ì¼ë¡ ëì ë ê°ì´ë¤. ì¦, "$a = 3"ì ê°ì 3ì´ ëë¤. ì´ê²ì ì¬ë¬ë¶ìê² ì½ê°ì í¸ë¦ì´ ê°ë¥íëë¡íë¤. <informalexample> <programlisting role="php"> $a = ($b = 4) + 5; // $aë 9, $bë 4ì ê°ì ê°ì§ë¤. </programlisting> </informalexample> </para> <para> 기본ì ì¸ ëì ì°ì°ì ì¸ì 모ë Bit ë¨ì ì°ì°ì, ì°ì ì°ì°ìì ê²°í©í ë³µí© ëì ì°ì°ìë ìë¤. ê²°í©ë ì°ì°ìë ííììì í´ë¹ ì°ì°ì¼ë¡ ì¬ì©ëê³ , ê·¸ ì°ì° ê°ì ì¼ìª½ì ìë í¼ì°ì°ìì ëì íë¤. ì를 ë¤ì´ : <informalexample> <programlisting role="php"> $a = 3; $a += 5; // $aë 8ì´ë¤. $a = $a + 5; ì ëì¼íë¤. $b = "Hello "; $b .= "There!"; // $bë "Hello There!"ê° ëë¤. $b = $b . "There!";ì ê°ë¤. </programlisting> </informalexample> </para> <para> Note that the assignment copies the original variable to the new one (assignment by value), so changes to one will not affect the other. This may also have relevance if you need to copy something like a large array inside a tight loop. PHP 4 supports assignment by reference, using the <computeroutput>$var = &$othervar;</computeroutput> syntax, but this is not possible in PHP 3. 'Assignment by reference' means that both variables end up pointing at the same data, and nothing is copied anywhere. To learn more about references, please read <link linkend="language.references">References explained</link>. </para> </sect1> <sect1 id="language.operators.bitwise"> <title>Bit ë¨ì ì°ì°ì (Bitwise Operators)</title> <simpara> ë¹í¸ ë¨ì ì°ì°ìë ì ìì ê°ë³ ë¹í¸ì ê°ì on, off í ì ìë¤. </simpara> <table> <title>Bitwise Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Result</entry> </row> </thead> <tbody> <row> <entry>$a & $b</entry> <entry>And</entry> <entry>$aì $bê° ëª¨ë 1ì¸ ë¹í¸ë§ 1ì´ ëë¤.</entry> </row> <row> <entry>$a | $b</entry> <entry>Or</entry> <entry>$aì $bì¤ íëë¼ë 1ì¸ ë¹í¸ë 1ì´ ëë¤.</entry> </row> <row> <entry>$a ^ $b</entry> <entry>Xor</entry> <entry>$aì $bì¤ íëë 1ì´ê³ , ë¤ë¥¸ íëë 0ì¸ ë¹í¸ë§ 1ì´ëê³ , ë머ì§ë 0ì´ ëë¤.</entry> </row> <row> <entry>~ $a</entry> <entry>Not</entry> <entry>$aìì 1ì¸ ë¹í¸ë 0ì¼ë¡, 0ì¸ ë¹í¸ë 1ë¡ ëë¤.</entry> </row> <row> <entry>$a << $b</entry> <entry>Shift left</entry> <entry>$aì ë¹í¸ë¤ì $b step ë§í¼ ì¼ìª½ì¼ë¡ shift íë¤. (í stepì 2를 í ë² ê³±íë ë§í¼ì í¨ê³¼ê° ìë¤.)</entry> </row> <row> <entry>$a >> $b</entry> <entry>Shift right</entry> <entry>$aì ë¹í¸ë¤ì $b step ë§í¼ ì¤ë¥¸ì¼ë¡ shift íë¤. (í stepì 2를 í ë² ëëë ë§í¼ì í¨ê³¼ê° ìë¤.)</entry> </row> </tbody> </tgroup> </table> </sect1> <sect1 id="language.operators.comparison"> <title>ë¹êµ ì°ì°ì (Comparison Operators)</title> <simpara> ë¹êµ ì°ì°ìë ì´ë¦ìì ì ì ìë¯ì´ ë ê°ì ê°ì ë¹êµíë ì°ì°ìì´ë¤. </simpara> <table> <title>Comparison Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Result</entry> </row> </thead> <tbody> <row> <entry>$a == $b</entry> <entry>Equal</entry> <entry>$aì $bê° ê°ì¼ë©´ true.</entry> </row> <row> <entry>$a === $b</entry> <entry>Identical</entry> <entry>$aì $bê° ê°ì¼ë©´ true. $aì $bì typeê¹ì§ ëì¼í´ì¼ íë¤. (PHP4 only)</entry> </row> <row> <entry>$a != $b</entry> <entry>Not equal</entry> <entry>$aì $bê° ë¤ë¥´ë©´ true.</entry> </row> <row> <entry>$a !== $b</entry> <entry>Not identical</entry> <entry>$aì $bê° ë¤ë¥´ë©´ ê°ì¼ë©´ true. $aì $bì typeë§ ë¬ë¼ë true. (PHP4 only) True if $a is not equal to $b, or they are not of the same type. (PHP 4 only) </entry> </row> <row> <entry>$a < $b</entry> <entry>Less than</entry> <entry>$aê° $bë³´ë¤ ìì¼ë©´ true.</entry> </row> <row> <entry>$a > $b</entry> <entry>Greater than</entry> <entry>$aê° $bë³´ë¤ í¬ë©´ true.</entry> </row> <row> <entry>$a <= $b</entry> <entry>Less than or equal to </entry> <entry>$aê° $bë³´ë¤ ìê±°ë ê°ì¼ë©´ true.</entry> </row> <row> <entry>$a >= $b</entry> <entry>Greater than or equal to </entry> <entry>$aê° $bë³´ë¤ í¬ê±°ë ê°ì¼ë©´ true.</entry> </row> </tbody> </tgroup> </table> <para> ë ë¤ë¥¸ ì¡°ê±´ ì°ì°ìë¡ Cë ë¤ë¥¸ ì¸ì´ì ìë "?:" ì°ì°ìê° ìë¤. <informalexample> <programlisting> (expr1) ? (expr2) : (expr3); </programlisting> </informalexample> ì´ ííìì <replaceable>expr1</replaceable>ì ê²°ê³¼ê° ì°¸ì´ë©´ <replaceable>expr2</replaceable>를 ë°ííê³ , ê±°ì§ì´ë©´ <replaceable>expr3</replaceable>를 ë°ííë¤. </para> </sect1> <sect1 id="language.operators.errorcontrol"> <title>ì¤ë¥ ì ì´ ì°ì°ì (Error control Operators)</title> <simpara> PHPë @(at íì)ì´ë¼ë í ê°ì ì¤ë¥ ì ì´ ì°ì°ì를 ì ê³µíë¤. PHPì ííì ìì ì´ íìê° ë¶ì¼ë©´, í´ë¹ ííììì ë°ìí 모ë ìë¬ ë©ìì§ê° 무ìëë¤. </simpara> <simpara> ë§ì½ <link linkend="ini.track-errors">track_errors</link> 기ë¥ì´ íì±í ëì´ ìë¤ë©´, í´ë¹ ííììì ë°ìí 모ë ìë¬ ë©ìì§ë $php_errormsg ë¼ë ì ì ë³ìì ì ì¥ë ê²ì´ë¤. ì´ ë³ìì ê°ì ë§¤ë² ìë¬ê° ë°ìí ëë§ë¤ ìë¡ ì¤ì ëë¤. ë°ë¼ì ë§ì½ ì¬ë¬ë¶ì´ ì´ ë³ì를 ì¬ì©íë ¤ë©´ ìë¬ê° ë°ìí ì§íì ìµëí 빨리 ì¬ì©íì¬ì¼ íë¤. </simpara> <para> <informalexample> <programlisting role="php"> <?php /* Intentional SQL error (extra quote): */ $res = @mysql_query ("select name, code from 'namelist") or die ("Query failed: error was '$php_errormsg'"); ?> </programlisting> </informalexample> </para> <simpara> See also <function>error_reporting</function>. </simpara> <warning> <para> Currently the "@" error-control operator prefix will even disable error reporting for critical errors that will terminate script execution. Among other things, this means that if you use "@" to suppress errors from a certain function and either it isn't available or has been mistyped, the script will die right there with no indication as to why. </para> </warning> </sect1> <sect1 id="language.operators.execution"> <title>ì¤í ì°ì°ì (Execution Operators)</title> <para> PHPë í ê°ì ì¤í ì°ì°ì를 ì ê³µíë¤. (``) ì¼ë° ìì ë°ì´íê° ìëì 주ìíì! PHPë ì´ ì¬ì´ì ìë ëª ë ¹ì shell ëª ë ¹ì´ë¡ ì¤ííê³ ê·¸ 결과를 ë°ííë¤. (ì¤í 결과를 ë¨ìí ì¶ë ¥íë ê²ì´ ìëê³ , ë³ííì¬ ë³ìì ì ì¥í ìë ìë¤.) <informalexample> <programlisting role="php"> $output = `ls -al`; echo "<pre>$output</pre>"; </programlisting> </informalexample> </para> <para> See also <function>system</function>, <function>passthru</function>, <function>exec</function>, <function>popen</function>, and <function>escapeshellcmd</function>. </para> </sect1> <sect1 id="language.operators.increment"> <title>ì¦ê°/ê°ì ì°ì°ì (Incrementing/Decrementing Operators)</title> <para> PHPë C ííì ì, ë¤ì ë¶ë ì¦ê°ë ê°ì ì°ì°ì를 ì ê³µíë¤. </para> <table> <title>Increment/decrement Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Effect</entry> </row> </thead> <tbody> <row> <entry>++$a</entry> <entry>Pre-increment</entry> <entry>$a 를 1 ì¦ê°ìí¨ í, $a를 ë°ííë¤</entry> </row> <row> <entry>$a++</entry> <entry>Post-increment</entry> <entry>$a를 ë°íí í,$a 를 1 ì¦ê°ìí¨ë¤.</entry> </row> <row> <entry>--$a</entry> <entry>Pre-decrement</entry> <entry>$a 를 1 ê°ììí¨ í, $a를 ë°ííë¤.</entry> </row> <row> <entry>$a--</entry> <entry>Post-decrement</entry> <entry>$a를 ë°íí í,$a 를 1 ê°ììí¨ë¤.</entry> </row> </tbody> </tgroup> </table> <para> $a를 ë°íí í,$a 를 1 ì¦ê°ìí¨ë¤.: <informalexample> <programlisting role="php"> <?php echo "<h3>Postincrement</h3>"; $a = 5; echo "Should be 5: " . $a++ . "<br>\n"; echo "Should be 6: " . $a . "<br>\n"; echo "<h3>Preincrement</h3>"; $a = 5; echo "Should be 6: " . ++$a . "<br>\n"; echo "Should be 6: " . $a . "<br>\n"; echo "<h3>Postdecrement</h3>"; $a = 5; echo "Should be 5: " . $a-- . "<br>\n"; echo "Should be 4: " . $a . "<br>\n"; echo "<h3>Predecrement</h3>"; $a = 5; echo "Should be 4: " . --$a . "<br>\n"; echo "Should be 4: " . $a . "<br>\n"; ?> </programlisting> </informalexample> </para> </sect1> <sect1 id="language.operators.logical"> <title>Logical Operators</title> <table> <title>Logical Operators</title> <tgroup cols="3"> <thead> <row> <entry>Example</entry> <entry>Name</entry> <entry>Result</entry> </row> </thead> <tbody> <row> <entry>$a and $b</entry> <entry>And</entry> <entry>$aì $bê° ëª¨ë true ì´ë©´ true.</entry> </row> <row> <entry>$a or $b</entry> <entry>Or</entry> <entry>$aì $bì¤ íëë¼ë trueì´ë©´ true.</entry> </row> <row> <entry>$a xor $b</entry> <entry>Xor</entry> <entry>$aì $bì¤ íëë§ trueì´ì´ì¼ true</entry> </row> <row> <entry>! $a</entry> <entry>Not</entry> <entry>$aê° trueê° ìëë©´ true</entry> </row> <row> <entry>$a && $b</entry> <entry>And</entry> <entry>$aì $bê° ëª¨ë true ì´ë©´ true.</entry> </row> <row> <entry>$a || $b</entry> <entry>Or</entry> <entry>$aì $bì¤ íëë¼ë trueì´ë©´ true.</entry> </row> </tbody> </tgroup> </table> <simpara> "and"ì "or" ì°ì°ìê° ëê°ì§ì ë¤ë¥¸ íí를 ê°ì§ê³ ìë ì´ì ë ì´ ì°ì°ìë¤ì´ ìë¡ ë¤ë¥¸ ì°ì ìì를 ê°ì§ê³ ì기 ë문ì´ë¤. (ìë <link linkend="language.operators.precedence">Operator Precedence</link>를 ë³´ë¼.) </simpara> </sect1> <sect1 id="language.operators.precedence"> <title>ì°ì°ì ì°ì ìì (Operator Precedence)</title> <para> ì°ì°ìë¤ì ì°ì ììë ë ê°ì ííìì¤ ì´ëê²ì´ ë ë¨ë¨í ë¬¶ì¬ ìëê°ë¥¼ ëª ê¸°íë¤. ì를ë¤ì´ <literal>1 + 5 * 3</literal>ì <literal>16</literal>ì ë°ííì§ <literal>18</literal>ì ë°ííì§ ìëë¤. ìëíë©´ ê³±í기("*")ì°ì°ìê° ëí기("+")ì°ì°ìë³´ë¤ ì°ì ììê° ë기 ë문ì´ë¤. íìíë©´ ê´í¸ë¥¼ ì¬ì©íì¬ ì°ì ìì를 ê°ì ì ì¼ë¡ ì¤ì í ì ìë¤. ì를ë¤ì´ <literal>(1 + 5) * 3</literal>ì ê²°ê³¼ë <literal>18</literal>ì´ ëë¤. </para> <para> ë¤ì íë ì°ì°ìì ì°ì ìì를 ëíë¸ë¤ ê°ì¥ ìì ìë ì°ì°ìì ì°ì ììê° ê°ì¥ ë®ë¤. <table> <title>Operator Precedence</title> <tgroup cols="2"> <thead> <row> <entry>Associativity</entry> <entry>Operators</entry> </row> </thead> <tbody> <row> <entry>left</entry> <entry>,</entry> </row> <row> <entry>left</entry> <entry>or</entry> </row> <row> <entry>left</entry> <entry>xor</entry> </row> <row> <entry>left</entry> <entry>and</entry> </row> <row> <entry>right</entry> <entry>print</entry> </row> <row> <entry>left</entry> <entry> = += -= *= /= .= %= &= |= ^= ~= <<= >>= </entry> </row> <row> <entry>left</entry> <entry>? :</entry> </row> <row> <entry>left</entry> <entry>||</entry> </row> <row> <entry>left</entry> <entry>&&</entry> </row> <row> <entry>left</entry> <entry>|</entry> </row> <row> <entry>left</entry> <entry>^</entry> </row> <row> <entry>left</entry> <entry>&</entry> </row> <row> <entry>non-associative</entry> <entry>== != === !==</entry> </row> <row> <entry>non-associative</entry> <entry>< <= > >=</entry> </row> <row> <entry>left</entry> <entry><< >></entry> </row> <row> <entry>left</entry> <entry>+ - .</entry> </row> <row> <entry>left</entry> <entry>* / %</entry> </row> <row> <entry>right</entry> <entry>! ~ ++ -- (int) (double) (string) (array) (object) @</entry> </row> <row> <entry>right</entry> <entry>[</entry> </row> <row> <entry>non-associative</entry> <entry>new</entry> </row> </tbody> </tgroup> </table> </para> </sect1> <sect1 id="language.operators.string"> <title>문ìì´ ì°ì°ì (String Operators)</title> <simpara> 문ìì´ ì°ì°ìë ëê°ê° ìë¤. 첫 ë²ì§¸ë ì¼ìª½ê³¼ ì¤ë¥¸ìª½ì ë 문ìì´ì ì°ê²°íë ì°ê²°(concatenation) ì°ì°ì (".") ê° ìë¤. ë ë²ì§¸ë ì°ê²° ëì ì°ì°ì (".=") ê° ìë¤. ì´ì ëí´ìë <link linkend="language.operators.assignment">ëì ì°ì°ì(Assugnment Operator)</link> ë¶ë¶ì ì½ì´ë³´ì. </simpara> <para> <informalexample> <programlisting role="php"> $a = "Hello "; $b = $a . "World!"; // now $b contains "Hello World!" $a = "Hello "; $a .= "World!"; // now $a contains "Hello World!" </programlisting> </informalexample> </para> </sect1> </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 sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: -->