Doc #54336 [NEW]: wrong variables

From: Date: Mon, 21 Mar 2011 13:51:11 +0000
Subject: Doc #54336 [NEW]: wrong variables
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6114@lists.php.net to get a copy of this message
From: Operating system: PHP version: 5.3.6 Package: Documentation problem Bug Type: Documentation Problem Bug description:wrong variables Description: ------------ --- From manual page: http://www.php.net/function.arsort#Exemplos --- The variable $fruits isn't declared. $frutas must be used. The variables $key and $val are wrong too. <?php $frutas = array("d" => "limao", "a" => "laranja", "b" => "banana", "c" => "melancia"); arsort($frutas); foreach ($fruits as $key => $val) { echo "$chave = $valor\n"; } ?> Test script: --------------- <?php $frutas = array("d" => "limao", "a" => "laranja", "b" => "banana", "c" => "melancia"); arsort($frutas); foreach ($fruits as $key => $val) { echo "$chave = $valor\n"; } ?> Expected result: ---------------- <?php $frutas = array("d" => "limao", "a" => "laranja", "b" => "banana", "c" => "melancia"); arsort($frutas); foreach ($frutas as $chave => $valor) { echo "$chave = $valor\n"; } ?> Actual result: -------------- "" -- Edit bug report at http://bugs.php.net/bug.php?id=54336&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54336&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54336&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54336&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54336&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54336&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54336&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54336&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54336&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54336&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54336&r=support Expected behavior: http://bugs.php.net/fix.php?id=54336&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54336&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54336&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54336&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54336&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54336&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54336&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54336&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54336&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54336&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54336&r=mysqlcfg

« previous php.doc.bugs (#6114) next »