From 0548a205b3c21b96388ffd445d8526ca1577347a Mon Sep 17 00:00:00 2001 From: leonardolara Date: Mon, 20 Jan 2025 19:39:08 -0300 Subject: [PATCH] sync with en rev --- appendices/ini.list.xml | 4 +- language-snippets.ent | 64 +++++++++-- language/control-structures/require.xml | 10 +- language/enumerations.xml | 4 +- reference/array/functions/array-unique.xml | 14 ++- reference/bc/bcmath.number.xml | 119 +++++++++++++++++++++ reference/bc/book.xml | 3 +- reference/bc/functions/bcadd.xml | 3 +- reference/bc/functions/bcceil.xml | 3 +- reference/bc/functions/bccomp.xml | 9 +- reference/bc/functions/bcdiv.xml | 3 +- reference/bc/functions/bcdivmod.xml | 5 +- reference/bc/functions/bcfloor.xml | 3 +- reference/bc/functions/bcmod.xml | 3 +- reference/bc/functions/bcmul.xml | 3 +- reference/bc/functions/bcpow.xml | 3 +- reference/bc/functions/bcpowmod.xml | 3 +- reference/bc/functions/bcround.xml | 3 +- reference/bc/functions/bcsqrt.xml | 3 +- reference/bc/functions/bcsub.xml | 3 +- reference/bc/ini.xml | 5 +- reference/gmp/gmp/construct.xml | 4 +- 22 files changed, 235 insertions(+), 39 deletions(-) create mode 100644 reference/bc/bcmath.number.xml diff --git a/appendices/ini.list.xml b/appendices/ini.list.xml index fe1038521..b6932a0a8 100644 --- a/appendices/ini.list.xml +++ b/appendices/ini.list.xml @@ -1,5 +1,5 @@ - +
Lista de diretivas do &php.ini; @@ -452,7 +452,7 @@ mail.force_extra_parameters &null; - Somente no &php.ini; + INI_SYSTEM diff --git a/language-snippets.ent b/language-snippets.ent index 9b2519da5..6ac0f684d 100755 --- a/language-snippets.ent +++ b/language-snippets.ent @@ -1,5 +1,5 @@ - + @@ -1702,6 +1702,7 @@ seja inserido, por exemplo, com '> + Os exemplos a seguir usam um arquivo book.xml que contém o seguinte: @@ -1742,6 +1743,28 @@ seja inserido, por exemplo, com das constantes de opções da libxml. '> + + Também é possível passar Dom\HTML_NO_DEFAULT_NS + para desabilitar o uso do namespace HTML e o elemento modelo. + Isto só deve ser usado se as implicações forem adequadamente compreendidas. +'> + + + A codificação na qual o documento foi criado. + Se não informada, tentará determinar a codificação que é mais comumente usada. +'> + + + &reftitle.notes; + + + Espaço em branco nas etiquetas html e head + não é considerado significativo e pode perder a formatação. + + +'> + registerNodeNS @@ -1753,6 +1776,14 @@ seja inserido, por exemplo, com '> + + Opções Adicionais. + As opções LIBXML_NOEMPTYTAG + e LIBXML_NOXMLDECL são suportadas. + Antes do PHP 8.3.0, apenas a opção LIBXML_NOEMPTYTAG + era suportada. +'> + DOM_HIERARCHY_REQUEST_ERR @@ -1768,9 +1799,9 @@ seja inserido, por exemplo, com DOM_HIERARCHY_REQUEST_ERR - Emitido se este nó é de um tipo que não permite filhos do - tipo de um dos nodes informados, ou se o nó a ser - inserido é um dos ancestrais deste nó, ou o próprio nó. + Emitido se este nó é de um tipo que não permite filhos do + tipo de um dos nodes informados, ou se o nó a ser + inserido é um dos ancestrais deste nó, ou o próprio nó. '> @@ -1779,12 +1810,33 @@ seja inserido, por exemplo, com DOM_WRONG_DOCUMENT_ERR - Emitido se um dos nodes informados foi criado a partir de um documento - diferente daquele que criou este nó. + Emitido se um dos nodes informados foi criado a partir de um documento + diferente daquele que criou este nó. '> + + + Lança uma exceção Dom\DOMException com código + Dom\WRONG_DOCUMENT_ERR se node + for de outro documento. + +'> + + + + Lança uma exceção ValueError se + options contiver uma opção inválida. + + + + + Lança uma exceção ValueError s + overrideEncoding for uma codificação desconhecida. + +'> + DOMException com código DOM_HIERARCHY_REQUEST_ERR.'> diff --git a/language/control-structures/require.xml b/language/control-structures/require.xml index f19668e19..9574b08a3 100644 --- a/language/control-structures/require.xml +++ b/language/control-structures/require.xml @@ -1,5 +1,5 @@ - + require @@ -7,10 +7,10 @@ A declaração require é idêntica a include - exceto que em caso de falha também produzirá um erro fatal de nível - E_COMPILE_ERROR. Em outras palavras, ele parará - o script enquanto que o include apenas emitirá um alerta - (E_WARNING) permitindo que o script continue. + exceto que em caso de falha também produzirá uma exceção Error + (erro de nível E_COMPILE_ERROR antes do + PHP 8.0.0) enquanto que include apenas emitirá um alerta + (nível de erro E_WARNING). Veja a documentação include para saber como isso funciona. diff --git a/language/enumerations.xml b/language/enumerations.xml index f28009d74..36f7fdac3 100644 --- a/language/enumerations.xml +++ b/language/enumerations.xml @@ -1,4 +1,4 @@ - + Enumerações @@ -511,7 +511,7 @@ enum Tamanho Enumerações podem utilizar traits, que se comportam da mesma maneira que nas classes. A limitação é que usados com use em uma enum não podem conter propriedades. - Eles podem incluir apenas métodos e métodos estáticos. Um trait com propriedades + Eles podem incluir apenas métodos, métodos estáticos e constantes. Um trait com propriedades resultará em um erro fatal. diff --git a/reference/array/functions/array-unique.xml b/reference/array/functions/array-unique.xml index 302581b8c..579bd8828 100644 --- a/reference/array/functions/array-unique.xml +++ b/reference/array/functions/array-unique.xml @@ -1,5 +1,5 @@ - + array_unique @@ -25,8 +25,8 @@ Dois elementos são considerados iguais se, e somente se, - (string) $elem1 === (string) $elem2. Em palavras: - quando a represetação em string é a mesma, o primeiro elemento será usado. + (string) $elem1 === (string) $elem2, ou seja, + quando a representação em string é a mesma, o primeiro elemento será usado. @@ -119,9 +119,11 @@ "verde", "vermelho", "b" => "verde", "azul", "vermelho"); + +$input = ["a" => "verde", "vermelho", "b" => "verde", "azul", "vermelho"]; $result = array_unique($input); print_r($result); + ?> ]]> @@ -144,9 +146,11 @@ Array ]]> diff --git a/reference/bc/bcmath.number.xml b/reference/bc/bcmath.number.xml new file mode 100644 index 000000000..ea6337dcf --- /dev/null +++ b/reference/bc/bcmath.number.xml @@ -0,0 +1,119 @@ + + + + + A classe BcMath\Number + BcMath\Number + + +
+ &reftitle.intro; + + Uma classe para número de precisão arbitrária. + Estes objetos suportam sobrecarga de operadores + aritméticos e + comparativos. + + + + + Esta classe não é afetada pela diretiva INI + bcmath.scale + definida no &php.ini;. + + + + + + O comportamento de um operador sobrecarregado é o mesmo que especificar &null; para o + parâmetro scale no método correspondente. + + +
+ +
+ &reftitle.classsynopsis; + + + + final + readonly + BcMath\Number + + + + implements + Stringable + + + &Properties; + + public + string + value + + + public + int + scale + + + &Methods; + + + + + + + +
+ +
+ &reftitle.properties; + + + value + + + Uma representação string de um número de precisão arbitrária. + + + + + scale + + + O valor de escala atualmente definido no objeto. + Para objetos resultantes de cálculos, este valore é computado e definido automaticamente, + a menos que o parâmetro scale tenha sido definido no método de cálculo. + + + + +
+ +
+ + &reference.bc.bcmath.entities.number; + +
+ diff --git a/reference/bc/book.xml b/reference/bc/book.xml index 5fab07157..bf0eed52f 100644 --- a/reference/bc/book.xml +++ b/reference/bc/book.xml @@ -1,5 +1,5 @@ - + @@ -48,6 +48,7 @@ echo bcsub($num1, $num2, 1); // => '0.0' &reference.bc.setup; &reference.bc.reference; + &reference.bc.bcmath.number; diff --git a/reference/bc/functions/bcadd.xml b/reference/bc/functions/bcadd.xml index 62fc93243..b03701024 100644 --- a/reference/bc/functions/bcadd.xml +++ b/reference/bc/functions/bcadd.xml @@ -1,5 +1,5 @@ - + bcadd @@ -115,6 +115,7 @@ echo bcadd($a, $b, 4); // 6.2340 bcsub + BcMath\Number::add diff --git a/reference/bc/functions/bcceil.xml b/reference/bc/functions/bcceil.xml index 35c77331b..7d2ae840b 100644 --- a/reference/bc/functions/bcceil.xml +++ b/reference/bc/functions/bcceil.xml @@ -1,5 +1,5 @@ - + bcceil @@ -76,6 +76,7 @@ string(2) "-3" bcfloor bcround + BcMath\Number::ceil diff --git a/reference/bc/functions/bccomp.xml b/reference/bc/functions/bccomp.xml index dd862fdab..fee3c8493 100644 --- a/reference/bc/functions/bccomp.xml +++ b/reference/bc/functions/bccomp.xml @@ -1,5 +1,5 @@ - + bccomp @@ -74,6 +74,13 @@ echo bccomp('1.00001', '1', 5); // 1
+ + + &reftitle.seealso; + + BcMath\Number::compare + + + bcdiv @@ -113,6 +113,7 @@ echo bcdiv('105', '6.55957', 3); // 16.007 bcdivmod bcmod bcmul + BcMath\Number::div diff --git a/reference/bc/functions/bcdivmod.xml b/reference/bc/functions/bcdivmod.xml index 6cbad84fc..b566666e6 100644 --- a/reference/bc/functions/bcdivmod.xml +++ b/reference/bc/functions/bcdivmod.xml @@ -1,5 +1,5 @@ - + bcdivmod @@ -9,7 +9,7 @@ &reftitle.description; - stringbcdivmod + arraybcdivmod stringnum1 stringnum2 intnullscale&null; @@ -81,6 +81,7 @@ echo $rem; // 0.5 bcdiv bcmod + BcMath\Number::divmod diff --git a/reference/bc/functions/bcfloor.xml b/reference/bc/functions/bcfloor.xml index 2987e9c30..033e38e89 100644 --- a/reference/bc/functions/bcfloor.xml +++ b/reference/bc/functions/bcfloor.xml @@ -1,5 +1,5 @@ - + bcfloor @@ -60,6 +60,7 @@ string(2) "-4" bcceil bcround + BcMath\Number::floor diff --git a/reference/bc/functions/bcmod.xml b/reference/bc/functions/bcmod.xml index 041191d79..1e08c38b4 100644 --- a/reference/bc/functions/bcmod.xml +++ b/reference/bc/functions/bcmod.xml @@ -1,5 +1,5 @@ - + bcmod @@ -112,6 +112,7 @@ echo bcmod('5.7', '1.3'); // 0.5 no PHP 7.2.0; anteriormente 0 bcdiv bcdivmod + BcMath\Number::mod diff --git a/reference/bc/functions/bcmul.xml b/reference/bc/functions/bcmul.xml index f27c3da11..bdf7328b1 100644 --- a/reference/bc/functions/bcmul.xml +++ b/reference/bc/functions/bcmul.xml @@ -1,5 +1,5 @@ - + bcmul @@ -103,6 +103,7 @@ echo bcmul('5', '2', 2); // Exibe "10", não "10.00" bcdiv + BcMath\Number::mul diff --git a/reference/bc/functions/bcpow.xml b/reference/bc/functions/bcpow.xml index 88ada121a..377bfc2bd 100644 --- a/reference/bc/functions/bcpow.xml +++ b/reference/bc/functions/bcpow.xml @@ -1,5 +1,5 @@ - + bcpow @@ -151,6 +151,7 @@ echo bcpow('5', '2', 2); // Imprime "25", não "25.00" bcpowmod bcsqrt + BcMath\Number::pow diff --git a/reference/bc/functions/bcpowmod.xml b/reference/bc/functions/bcpowmod.xml index 2c52dd918..464e6de1b 100644 --- a/reference/bc/functions/bcpowmod.xml +++ b/reference/bc/functions/bcpowmod.xml @@ -1,5 +1,5 @@ - + bcpowmod @@ -153,6 +153,7 @@ $b = bcmod(bcpow($x, $y), $mod); bcpow bcmod + BcMath\Number::powmod diff --git a/reference/bc/functions/bcround.xml b/reference/bc/functions/bcround.xml index 7f439e258..37f9ac65c 100644 --- a/reference/bc/functions/bcround.xml +++ b/reference/bc/functions/bcround.xml @@ -1,5 +1,5 @@ - + bcround @@ -272,6 +272,7 @@ string(4) "-1.5" bcceil bcfloor + BcMath\Number::round diff --git a/reference/bc/functions/bcsqrt.xml b/reference/bc/functions/bcsqrt.xml index 63fcf8098..ae3adec65 100644 --- a/reference/bc/functions/bcsqrt.xml +++ b/reference/bc/functions/bcsqrt.xml @@ -1,5 +1,5 @@ - + bcsqrt @@ -113,6 +113,7 @@ echo bcsqrt('2', 3); // 1.414 bcpow + BcMath\Number::sqrt diff --git a/reference/bc/functions/bcsub.xml b/reference/bc/functions/bcsub.xml index 390465f0f..0ffe6b8c3 100644 --- a/reference/bc/functions/bcsub.xml +++ b/reference/bc/functions/bcsub.xml @@ -1,5 +1,5 @@ - + bcsub @@ -79,6 +79,7 @@ echo bcsub($a, $b, 4); // -3.7660 bcadd + BcMath\Number::sub diff --git a/reference/bc/ini.xml b/reference/bc/ini.xml index 53737042b..ad5d172a7 100644 --- a/reference/bc/ini.xml +++ b/reference/bc/ini.xml @@ -1,5 +1,5 @@ - +
&reftitle.runtime; &extension.runtime; @@ -42,6 +42,9 @@ Número de casas decimais para todas as funções BC Math. Veja também bcscale. + + BcMath\Number não é afetada por esta configuração. + diff --git a/reference/gmp/gmp/construct.xml b/reference/gmp/gmp/construct.xml index 2e675e369..fd7b5cb24 100644 --- a/reference/gmp/gmp/construct.xml +++ b/reference/gmp/gmp/construct.xml @@ -18,9 +18,7 @@ - - - +