php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #52702 [ES] The Documentation of $GLOBALS has an error in example # 1
Submitted: 2010-08-25 21:33 UTC Modified: 2010-09-22 17:49 UTC
From: kadosh dot ivan at gmail dot com Assigned: yago (profile)
Status: Closed Package: Translation problem
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kadosh dot ivan at gmail dot com
New email:
PHP Version: OS:

 

 [2010-08-25 21:33 UTC] kadosh dot ivan at gmail dot com
Description:
------------
<?php
function test() {
    $foo = "variable local";

    echo '$foo en el ámbito simple: ' . $GLOBALS["foo"] . "\n";
    echo '$foo en el ámbito global: ' . $foo . "\n";
}

$foo = "Contenido de ejemplo";
test();
?>

El resultado del ejemplo sería algo similar a:
$foo en el ámbito global: Contenido de ejemplo
$foo en el ámbito simple: variable local

Test script:
---------------
The result is not correct. This confused me for some minutes until I read very clearly and I realized about the error.

Expected result:
----------------
$foo en el ámbito simple: Contenido de ejemplo
$foo en el ámbito global: variable local

That would be the result according to the function. But according to the use of 
$GLOBALS it should be:

$foo en el ámbito global: Contenido de ejemplo
$foo en el ámbito simple: variable local

Actual result:
--------------
$foo en el ámbito global: Contenido de ejemplo
$foo en el ámbito simple: variable local

I realized that the same documentation but in english is correct.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-28 13:46 UTC] + at ni-po dot com
This ought to be a 'Documentation translation problem', the English version is correct. (The Spanish one though is not.)
 [2010-09-20 18:25 UTC] philip@php.net
-Summary: The Documentation of $GLOBALS has an error in example # 1 +Summary: [ES] The Documentation of $GLOBALS has an error in example # 1 -Package: Documentation problem +Package: Translation problem
 [2010-09-22 17:46 UTC] yago@php.net
Automatic comment from SVN on behalf of yago
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=303683
Log: Solved bug #52702
 [2010-09-22 17:49 UTC] yago@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: yago
 [2010-09-22 17:49 UTC] yago@php.net
Gracias Ivan Kadosh por reportar este bug.
Los cambios serán publicados el próximo viernes.
Saludos.

Yago
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 20:01:35 2025 UTC