Doc #52702 [NEW]: The Documentation of $GLOBALS has an error in example # 1
| From: | kadosh dot ivan at gmail dot com | Date: | Wed, 25 Aug 2010 19:33:26 +0000 |
| Subject: | Doc #52702 [NEW]: The Documentation of $GLOBALS has an error in example # 1 | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-4930@lists.php.net to get a copy of this message | ||
From:
Operating system: Windows
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:The Documentation of $GLOBALS has an error in example # 1
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.
--
Edit bug report at http://bugs.php.net/bug.php?id=52702&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52702&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52702&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52702&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=52702&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52702&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=52702&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=52702&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=52702&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=52702&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=52702&r=support
Expected behavior: http://bugs.php.net/fix.php?id=52702&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=52702&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=52702&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=52702&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52702&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52702&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=52702&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=52702&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=52702&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=52702&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=52702&r=mysqlcfg