From 0b560ff961daf3cfd5de22612be87f1312852909 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Sat, 4 Apr 2026 08:45:19 +0200 Subject: [PATCH 1/3] Sync EN: Add GMP as example of internal object overloading bool cast Fixes #465 --- language/types/boolean.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/language/types/boolean.xml b/language/types/boolean.xml index 02afe4964..e70a5acfd 100644 --- a/language/types/boolean.xml +++ b/language/types/boolean.xml @@ -1,5 +1,5 @@ - + Booleano @@ -100,7 +100,7 @@ if ($show_separators) { - los objetos internos que sobrecargan su comportamiento de casting en booleano. Por ejemplo: los objetos SimpleXML creados a partir de elementos vacíos sin atributos. + los objetos internos que sobrecargan su comportamiento de casting en booleano. Por ejemplo: los objetos SimpleXML creados a partir de elementos vacíos sin atributos, o los objetos GMP que representan el valor 0. From 2c7b9a996f73edb01e173b3818cdaf80e53120a1 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Sat, 4 Apr 2026 08:45:28 +0200 Subject: [PATCH 2/3] Sync EN: Add curly brace escaping example in strings Fixes #463 --- language/types/string.xml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/language/types/string.xml b/language/types/string.xml index 85c309863..b353bc75b 100644 --- a/language/types/string.xml +++ b/language/types/string.xml @@ -1,5 +1,5 @@ - + Cadenas @@ -921,10 +921,13 @@ $arr = [ ]; // No funcionará, mostrará: Esto es { fantástico} -echo "Esto es { $great}"; +echo "Esto es { $great}" . PHP_EOL; // Funciona, mostrará: Esto es fantástico -echo "Esto es {$great}"; +echo "Esto es {$great}" . PHP_EOL; + +// Para mostrar llaves en la salida: +echo "Esto es {{$great}}" . PHP_EOL; class Square { public $width; @@ -935,29 +938,29 @@ class Square { $square = new Square(5); // Funciona -echo "Este cuadrado mide {$square->width}00 centímetros de ancho."; +echo "Este cuadrado mide {$square->width}00 centímetros de ancho." . PHP_EOL; // Funciona, las claves entre comillas solo funcionan con la sintaxis de llaves -echo "Esto funciona: {$arr['key']}"; +echo "Esto funciona: {$arr['key']}" . PHP_EOL; // Funciona -echo "Esto funciona: {$arr[3][2]}"; +echo "Esto funciona: {$arr[3][2]}" . PHP_EOL; -echo "Esto funciona: {$arr[DATA_KEY]}"; +echo "Esto funciona: {$arr[DATA_KEY]}" . PHP_EOL; // Al utilizar arrays multidimensionales, siempre use llaves alrededor de los arrays // cuando estén dentro de strings -echo "Esto funciona: {$arr['foo'][2]}"; +echo "Esto funciona: {$arr['foo'][2]}" . PHP_EOL; -echo "Esto funciona: {$obj->values[3]->name}"; +echo "Esto funciona: {$obj->values[3]->name}" . PHP_EOL; -echo "Esto funciona: {$obj->$staticProp}"; +echo "Esto funciona: {$obj->$staticProp}" . PHP_EOL; // No funcionará, mostrará: C:\directory\{fantástico}.txt -echo "C:\directory\{$great}.txt"; +echo "C:\directory\{$great}.txt" . PHP_EOL; // Funciona, mostrará: C:\directory\fantástico.txt -echo "C:\\directory\\{$great}.txt"; +echo "C:\\directory\\{$great}.txt" . PHP_EOL; ?> ]]> From 6cd2d5d458cddc673e301a1d40e34431d4ebbad1 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Sat, 4 Apr 2026 08:45:32 +0200 Subject: [PATCH 3/3] Sync EN: Add inherited class example to AllowDynamicProperties Fixes #464 --- .../attributes/allowdynamicproperties.xml | 53 ++++++++++++++++--- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/language/predefined/attributes/allowdynamicproperties.xml b/language/predefined/attributes/allowdynamicproperties.xml index 887881315..a1af22f6a 100644 --- a/language/predefined/attributes/allowdynamicproperties.xml +++ b/language/predefined/attributes/allowdynamicproperties.xml @@ -1,5 +1,5 @@ - + El atributo AllowDynamicProperties @@ -9,10 +9,19 @@
&reftitle.intro; - + Este atributo se utiliza para marcar clases que permiten propiedades dinámicas. - + + + + Aunque los atributos en sí no se heredan, el efecto del atributo + AllowDynamicProperties + se hereda. Las clases hijas de una clase marcada con este atributo también + permitirán propiedades dinámicas, incluso si no declaran el atributo + explícitamente. + +
@@ -35,12 +44,13 @@
&reftitle.examples; - + Las propiedades dinámicas están deprecadas a partir de PHP 8.2.0, por lo que usarlas sin marcar la clase con este atributo emitirá un aviso de deprecación. - - + + + AllowDynamicProperties con propiedad inexistente nonExistingProp = true; Deprecated: Creation of dynamic property DefaultBehaviour::$nonExistingProp is deprecated in file on line 10 ]]> - + + + AllowDynamicProperties con propiedad inexistente en clase heredada + + nonExistingProp = true; +$o2->nonExistingProp = true; +?> +]]> + + &example.outputs.82; + + + +
&reftitle.seealso; - Visión general de los atributos + Visión general de los atributos