cvs: phpdoc-pt_BR /language operators.xml

From: Date: Sat, 05 Apr 2003 22:56:35 +0000
Subject: cvs: phpdoc-pt_BR /language operators.xml
Groups: php.doc.pt-br 
Request: Send a blank email to doc-pt-br+get-759@lists.php.net to get a copy of this message
ae Sat Apr 5 17:56:35 2003 EDT Modified files: /phpdoc-pt_BR/language operators.xml Log: update translation Index: phpdoc-pt_BR/language/operators.xml diff -u phpdoc-pt_BR/language/operators.xml:1.7 phpdoc-pt_BR/language/operators.xml:1.8 --- phpdoc-pt_BR/language/operators.xml:1.7 Sun Oct 20 22:04:21 2002 +++ phpdoc-pt_BR/language/operators.xml Sat Apr 5 17:56:34 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.40 Maintainer: ae Status: ready --> +<!-- EN-Revision: 1.46 Maintainer: ae Status: ready --> <chapter id="language.operators"> <title>Operadores</title> <simpara> @@ -53,7 +53,7 @@ <row> <entry>esquerda</entry> <entry> - = += -= *= /= .= %= &amp;= |= ^= ~= &lt;&lt;= &gt;&gt;= + = += -= *= /= .= %= &amp;= |= ^= &lt;&lt;= &gt;&gt;= </entry> </row> <row> @@ -116,6 +116,15 @@ </tgroup> </table> </para> + <note> + <para> + Mesmo tendo <literal>!</literal> maior precedência que + <literal>=</literal>, o PHP ainda permitirá expressões + similares à seguinte: <literal>if (!$a = foo())</literal>, + que no caso terá como resultado que <literal>foo()</literal> é + recebido em <varname>$a</varname>. + </para> + </note> </sect1> <sect1 id="language.operators.arithmetic"> @@ -165,9 +174,13 @@ </table> <simpara> O operador de divisão ("/") sempre retorna um valor com ponto flutuante, - mesmo que os dois operandos sejam inteiros (ou strings que sejam + mesmo que os dois operandos sejam inteiros (ou strings convetidos para inteiros). </simpara> + <simpara> + Veja também a página do manual + <link linkend="ref.math">funções matemáticas</link>. + </simpara> <!-- <simpara> @@ -390,15 +403,31 @@ <informalexample> <programlisting role="php"> <![CDATA[ -(expr1) ? (expr2) : (expr3); +<?php +// Exemplo de uso do operador trinário +$action = (empty($_POST['action'])) ? 'default' : $_POST['action']; + +// A instrucao assima eh identica a seguinte instrucao if/else +if (empty($_POST['action'])) { + $action = 'default'; +} else { + $action = $_POST['action']; +} +?> ]]> </programlisting> </informalexample> - Esta expressão avalia para <replaceable>expr2</replaceable> se + A expressão <literal>(expr1) ? (expr2) : (expr3)</literal> + é avaliada para <replaceable>expr2</replaceable> se <replaceable>expr1</replaceable> é avaliada como &true;, ou <replaceable>expr3</replaceable> se <replaceable>expr1</replaceable> é avaliada como &false;. </para> + <para> + Vaj também <function>strcasecmp</function>, + <function>strcmp</function>, e a seção do manual sobre + <link linkend="language.types">Tipos</link>. + </para> </sect1> <sect1 id="language.operators.errorcontrol"> @@ -447,7 +476,8 @@ </simpara> </note> <simpara> - Veja também: <function>error_reporting</function>. + Veja também <function>error_reporting</function> e a seção do manual sobre + <link linkend="ref.errorfunc">funções de Manipulação de Erros e Logging</link>. </simpara> <note> <para> @@ -474,7 +504,8 @@ não são apóstrofes! O PHP tentará executar o conteúdo dos acentos graves como um comando do shell; a saída será retornada (isto é, ela não será simplesmente descarregada para a saída; - ela pode ser atribuída a uma variável). + ela pode ser atribuída a uma variável). A utilização do operador contra-apóstrofo é idêntica + a função <function>shell_exec</function>. <informalexample> <programlisting role="php"> <![CDATA[ @@ -486,15 +517,16 @@ </para> <note> <para> - O operador de execução fica desabilitado quando o <link - linkend="ini.safe-mode">safe mode</link> está ativo + O operador de execução fica desabilitado quando &safemode; está ativo ou <function>shell_exec</function> está desabilitado. </para> </note> <para> - Veja também: <function>escapeshellcmd</function>, <function>exec</function>, - <function>passthru</function>, <function>popen</function>, - <function>shell_exec</function> e <function>system</function>. + Veja também a seção do manual sobre <link linkend="ref.exec">funções + de execução de programas</link>, <function>popen</function> + <function>proc_open</function> e + <link linkend="features.commandline">Utilizando o PHP em linha de + comando</link>. </para> </sect1> @@ -650,6 +682,11 @@ </programlisting> </informalexample> </para> + <para> + Veja também as seções do manual sobre o + <link linkend="language.types.string">tipo String</link> e as + <link linkend="ref.strings">funções de manipulação de Strings</link>. + </para> </sect1> <sect1 id="language.operators.array"> @@ -685,6 +722,11 @@ ]]> </screen> </informalexample> + </para> + <para> + Veja também as seções do manual sobre o + <link linkend="language.types.array">tipo Array</link> e + <link linkend="ref.array">funções de manipulação de Arrays</link>. </para> </sect1> </chapter>

« previous php.doc.pt-br (#759) next »