mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
- Update
git-svn-id: https://svn.php.net/repository/phpdoc/pt_BR/trunk@259066 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!-- EN-Revision: 1.39 Maintainer: felipe Status: ready --><!-- CREDITS: ae -->
|
||||
<!-- EN-Revision: 1.40 Maintainer: felipe Status: ready --><!-- CREDITS: ae -->
|
||||
|
||||
<!ENTITY PHPManual "Manual do PHP">
|
||||
<!ENTITY Date "Data:">
|
||||
@@ -28,7 +28,7 @@
|
||||
<!ENTITY MailRelatedExtensions "Extensões Relacionadas a Mail">
|
||||
<!ENTITY AuthenticationServices "Serviços de Autenticação">
|
||||
<!ENTITY OtherServices "Outros Serviços">
|
||||
<!ENTITY CompressionExtensions "Extensões de Compressão">
|
||||
<!ENTITY CompressionExtensions "Extensões de Compressão e Arquivo">
|
||||
<!ENTITY CalendarandEventRelatedExtensions "Extensões Relacionadas a Calendário e Evento">
|
||||
<!ENTITY NonTextMIMEOutput "Saída de MIME Não-Texto">
|
||||
<!ENTITY ImageProcessingandGeneration "Processamento de Imagem e Geração">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- EN-Revision: 1.123 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.124 Maintainer: felipe Status: ready -->
|
||||
<chapter xml:id="language.operators" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>Operadores</title>
|
||||
<simpara>
|
||||
@@ -1199,6 +1199,7 @@ var_dump($a === $b); // bool(false)
|
||||
class MyClass
|
||||
{
|
||||
}
|
||||
|
||||
class NotMyClass
|
||||
{
|
||||
}
|
||||
@@ -1217,6 +1218,8 @@ bool(false)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<literal>instanceof</literal> pode também ser usado para determinar se uma variável
|
||||
é um objeto instânciado de uma classe que herda de uma classe pai:
|
||||
<example>
|
||||
@@ -1227,9 +1230,11 @@ bool(false)
|
||||
class ParentClass
|
||||
{
|
||||
}
|
||||
|
||||
class MyClass extends ParentClass
|
||||
{
|
||||
}
|
||||
|
||||
$a = new MyClass;
|
||||
|
||||
var_dump($a instanceof MyClass);
|
||||
@@ -1245,6 +1250,8 @@ bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
Para verificar se um objeto <emphasis>não</emphasis> é uma instância de uma classe, o
|
||||
<link linkend="language.operators.logical">operador lógico <literal>not</literal>
|
||||
</link> pode ser usado.
|
||||
@@ -1257,6 +1264,7 @@ bool(true)
|
||||
class MyClass
|
||||
{
|
||||
}
|
||||
|
||||
$a = new MyClass;
|
||||
var_dump(!($a instanceof stdClass));
|
||||
?>
|
||||
@@ -1269,6 +1277,8 @@ bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
Por fim, <literal>instanceof</literal> pode também ser usado para determinar se
|
||||
uma variável é um objeto instânciado de uma classe que implementa uma
|
||||
<link linkend="language.oop5.interfaces">interface</link>:
|
||||
@@ -1280,9 +1290,11 @@ bool(true)
|
||||
interface MyInterface
|
||||
{
|
||||
}
|
||||
|
||||
class MyClass implements MyInterface
|
||||
{
|
||||
}
|
||||
|
||||
$a = new MyClass;
|
||||
|
||||
var_dump($a instanceof MyClass);
|
||||
@@ -1310,13 +1322,16 @@ bool(true)
|
||||
interface MyInterface
|
||||
{
|
||||
}
|
||||
|
||||
class MyClass implements MyInterface
|
||||
{
|
||||
}
|
||||
|
||||
$a = new MyClass;
|
||||
$b = new MyClass;
|
||||
$c = 'MyClass';
|
||||
$d = 'NotMyClass';
|
||||
|
||||
var_dump($a instanceof $b); // $b é umn objeto da classe MyClass
|
||||
var_dump($a instanceof $c); // $c é uma string 'MyClass'
|
||||
var_dump($a instanceof $d); // $d é uma string 'NotMyClass'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.argc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.argc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$argc</refname>
|
||||
<refpurpose>O número de argumentos passados para o script</refpurpose>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.argv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.argv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$argv</refname>
|
||||
<refpurpose>Array de argumentos passados para o script</refpurpose>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.cookies" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.cookies" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_COOKIE</refname>
|
||||
<refname>$HTTP_COOKIE_VARS [obsoleta]</refname>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.environment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.environment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_ENV</refname>
|
||||
<refname>$HTTP_ENV_VARS [obsoleta]</refname>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.files" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.files" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_FILES</refname>
|
||||
<refname>$HTTP_POST_FILES [obsoleta]</refname>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_GET</refname>
|
||||
<refname>$HTTP_GET_VARS [obsoleta]</refname>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.2 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.globals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.globals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$GLOBALS</refname>
|
||||
<refpurpose>Referencia todas variáveis disponíveis no escopo global</refpurpose>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.1 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.httprawpostdata" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.httprawpostdata" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$HTTP_RAW_POST_DATA</refname>
|
||||
<refpurpose>Informação não-tratada do POST</refpurpose>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.2 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.httpresponseheader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.httpresponseheader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$http_response_header</refname>
|
||||
<refpurpose>Cabeçalhos de resposta HTTP</refpurpose>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.1 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.phperrormsg" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.phperrormsg" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$php_errormsg</refname>
|
||||
<refpurpose>A mensagem de erro anterior</refpurpose>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.post" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.post" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_POST</refname>
|
||||
<refname>$HTTP_POST_VARS [deprecated]</refname>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.request" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.request" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_REQUEST</refname>
|
||||
<refpurpose>Variáveis de requisição HTTP</refpurpose>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready --><!-- CREDITS: ae -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready --><!-- CREDITS: ae -->
|
||||
|
||||
<refentry xml:id="reserved.variables.server" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.server" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_SERVER</refname>
|
||||
<refname>$HTTP_SERVER_VARS [deprecated]</refname>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="reserved.variables.session" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="reserved.variables.session" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_SESSION</refname>
|
||||
<refname>$HTTP_SESSION_VARS [obsoleta]</refname>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.1 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: felipe Status: ready -->
|
||||
|
||||
<refentry xml:id="language.variables.superglobals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="language.variables.superglobals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>Superglobais</refname>
|
||||
<refpurpose>Superglobais são variáveis nativas que estão sempre disponíveis em todos escopos</refpurpose>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- EN-Revision: 1.14 Maintainer: felipe Status: ready --><!-- CREDITS: lucasr -->
|
||||
<!-- EN-Revision: 1.15 Maintainer: felipe Status: ready --><!-- CREDITS: lucasr -->
|
||||
<refentry xml:id="function.array-pop" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>array_pop</refname>
|
||||
@@ -17,7 +17,9 @@
|
||||
elemento de <parameter>array</parameter>, diminuindo
|
||||
<parameter>array</parameter> em um elemento.
|
||||
Se <parameter>array</parameter> estiver vazio (ou se não for um array),
|
||||
o valor &null; é retornado.
|
||||
o valor &null; é retornado. Adicionalmente emitirá um
|
||||
<link linkend="errorfunc.constants.errorlevels.e-warning">aviso</link>
|
||||
quando chamado com um não-array.
|
||||
</para>
|
||||
&array.resetspointer;
|
||||
</refsect1>
|
||||
|
||||
@@ -1,38 +1,45 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- EN-Revision: 1.15 Maintainer: felipe Status: ready --><!-- CREDITS: ae -->
|
||||
<refentry xml:id="function.mt-rand" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>mt_rand</refname>
|
||||
<refpurpose>Gerador melhorado de números aleatórios</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- EN-Revision: 1.16 Maintainer: felipe Status: ready --><!-- CREDITS: ae -->
|
||||
<refentry xml:id="function.mt-rand" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>mt_rand</refname>
|
||||
<refpurpose>Gerador melhorado de números aleatórios</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>mt_rand</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>min</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>max</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
Muitos geradores de números aleatórios das libcs antigas são duvidosos ou com
|
||||
características duvidosas e lentos. Por default, o PHP utiliza o
|
||||
gerador de números aleatórios da libc para a função <function>rand</function>.
|
||||
A função <function>mt_rand</function> é um bom
|
||||
substituto para a primeira. Ela utiliza um gerador de números aleatórios com
|
||||
características conhecidas, o <link xlink:href="&url.mersenne;">
|
||||
Mersenne Twister</link>, que produzirá números randômicos quatro vezes
|
||||
mais rápido que média provida pela rand() da libc.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Se chamada sem os argumentos opcionais <parameter>min</parameter> e
|
||||
<parameter>max</parameter>, <function>mt_rand</function>
|
||||
retorna um pseudo número aletório enrte 0 e
|
||||
<constant>RAND_MAX</constant>. se você precisa de um número randômico
|
||||
entre 5 e 15 (inclusive), por exemplo, utilize <literal>mt_rand
|
||||
(5, 15)</literal>.
|
||||
</simpara>
|
||||
¬e.randomseed;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>mt_rand</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>mt_rand</methodname>
|
||||
<methodparam><type>int</type><parameter>min</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>max</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
Muitos geradores de números aleatórios das libcs antigas são duvidosos ou com
|
||||
características duvidosas e lentos. Por default, o PHP utiliza o
|
||||
gerador de números aleatórios da libc para a função <function>rand</function>.
|
||||
A função <function>mt_rand</function> é um bom
|
||||
substituto para a primeira. Ela utiliza um gerador de números aleatórios com
|
||||
características conhecidas, o <link xlink:href="&url.mersenne;">
|
||||
Mersenne Twister</link>, que produzirá números randômicos quatro vezes
|
||||
mais rápido que média provida pela rand() da libc.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Se chamada sem os argumentos opcionais <parameter>min</parameter> e
|
||||
<parameter>max</parameter>, <function>mt_rand</function>
|
||||
retorna um pseudo número aletório enrte 0 e
|
||||
<constant>RAND_MAX</constant>. se você precisa de um número randômico
|
||||
entre 5 e 15 (inclusive), por exemplo, utilize <literal>mt_rand
|
||||
(5, 15)</literal>.
|
||||
</simpara>
|
||||
|
||||
¬e.randomseed;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
@@ -78,11 +85,11 @@
|
||||
<row>
|
||||
<entry>Desde o 3.0.7</entry>
|
||||
<entry>
|
||||
Em versões anteriores a 3.0.7, o significado do parâmetro
|
||||
<parameter>max</parameter> era <parameter>range</parameter>. Assim, para
|
||||
obter os mesmos resultados do exemplo acima, você precisaria utilizar
|
||||
<literal>rand (5, 11)</literal> para obter um número aleatório
|
||||
entre 5 e 15.
|
||||
Em versões anteriores a 3.0.7, o significado do parâmetro
|
||||
<parameter>max</parameter> era <parameter>range</parameter>. Assim, para
|
||||
obter os mesmos resultados do exemplo acima, você precisaria utilizar
|
||||
<literal>rand (5, 11)</literal> para obter um número aleatório
|
||||
entre 5 e 15.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
@@ -116,6 +123,7 @@ echo mt_rand(5, 15);
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
@@ -124,9 +132,9 @@ echo mt_rand(5, 15);
|
||||
<member><function>mt_getrandmax</function></member>
|
||||
<member><function>rand</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
||||
@@ -1,38 +1,44 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- EN-Revision: 1.19 Maintainer: felipe Status: ready --><!-- CREDITS: ae -->
|
||||
<refentry xml:id="function.rand" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>rand</refname>
|
||||
<refpurpose>Gera um inteiro aleatório</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- EN-Revision: 1.20 Maintainer: felipe Status: ready --><!-- CREDITS: ae -->
|
||||
<refentry xml:id="function.rand" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>rand</refname>
|
||||
<refpurpose>Gera um inteiro aleatório</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>rand</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>min</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>max</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
Se chamado sem os parâmetros opcionais <parameter>min</parameter> e
|
||||
<parameter>max</parameter>, <function>rand</function>
|
||||
retornará um pseudo inteiro randômico entre 0 e
|
||||
<constant>RAND_MAX</constant>. Se você precisa de um número aleatório
|
||||
entre 5 e 15 (inclusive), por exemplo, utilize <literal>rand (5,
|
||||
15)</literal>.
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
Em algumas plataformas (como o Windows) <constant>RAND_MAX</constant>
|
||||
é somente 32768. Se você precisa de um número maior que 32768, especificando
|
||||
<parameter>min</parameter> e <parameter>max</parameter> permitirá
|
||||
você criar um intervalo maior que RAND_MAX, ou considere utilizar
|
||||
<function>mt_rand</function> ao invés.
|
||||
</simpara>
|
||||
</note>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>rand</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>rand</methodname>
|
||||
<methodparam><type>int</type><parameter>min</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>max</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<simpara>
|
||||
Se chamado sem os parâmetros opcionais <parameter>min</parameter> e
|
||||
<parameter>max</parameter>, <function>rand</function>
|
||||
retornará um pseudo inteiro randômico entre 0 e
|
||||
<constant>RAND_MAX</constant>. Se você precisa de um número aleatório
|
||||
entre 5 e 15 (inclusive), por exemplo, utilize <literal>rand (5,
|
||||
15)</literal>.
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
Em algumas plataformas (como o Windows) <constant>RAND_MAX</constant>
|
||||
é somente 32768. Se você precisa de um número maior que 32768, especificando
|
||||
<parameter>min</parameter> e <parameter>max</parameter> permitirá
|
||||
você criar um intervalo maior que RAND_MAX, ou considere utilizar
|
||||
<function>mt_rand</function> ao invés.
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
¬e.randomseed;
|
||||
¬e.randomseed;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
@@ -49,7 +55,7 @@
|
||||
<term><parameter>max</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The highest value to return (default: RAND_MAX)
|
||||
O maior valor para retornar (padrão: RAND_MAX)
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -116,6 +122,7 @@ echo rand(5, 15);
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
@@ -124,9 +131,9 @@ echo rand(5, 15);
|
||||
<member><function>getrandmax</function></member>
|
||||
<member><function>mt_rand</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- EN-Revision: 1.5 Maintainer: felipe Status: ready --><!-- CREDITS: fernandoc -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: felipe Status: ready --><!-- CREDITS: fernandoc -->
|
||||
<reference xml:id="class.mysqli-result" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<title>A classe MySQLi_Result</title>
|
||||
<titleabbrev>MySQLi_Result</titleabbrev>
|
||||
@@ -25,7 +25,7 @@
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>MySQLi_STMT</classname>
|
||||
<classname>MySQLi_Result</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: felipe Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: felipe Status: ready -->
|
||||
|
||||
<book xml:id="book.pcre" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>&Functions; para Expressões Regulares (Compatíveis com Perl)</title>
|
||||
@@ -9,7 +9,7 @@
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
A sintaxe para padrões usados nestas funções assemelham-se com Perl.
|
||||
A expressão precisa estar incluida entre delimitadores, uma
|
||||
A expressão precisa estar incluída entre delimitadores, uma
|
||||
barra (/), por exemplo. Qualquer caractere pode ser usado para
|
||||
delimitar desde que não seja alfanumérico ou backslash (\). Se
|
||||
o caractere delimitador tem de ser usado na própria expressão,
|
||||
|
||||
Reference in New Issue
Block a user