Doc #62459 [NEW]: Missing hint for fscanf

From: Date: Sun, 01 Jul 2012 16:47:26 +0000
Subject: Doc #62459 [NEW]: Missing hint for fscanf
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8526@lists.php.net to get a copy of this message
From: roman dot matzutt at rwth-aachen dot de Operating system: Linux PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:Missing hint for fscanf Description: ------------ --- From manual page: http://www.php.net/function.fscanf#refsect1-function.fscanf-unknown-seealsp --- In the German version of this documentation it is not mentioned that fscanf only reads one line at a time which causes failure when one wants to scan a (short) file as a whole. For instance, from the German documentation it did not came clear that the code snippet presented below will not work while the English documentation makes clear that this probably will not work. Test script: --------------- $file = fopen("filename", "r") or die("Could not open file for reading."); fscanf($file, "%d\n$d", $int1, $int2); fclose($file); Expected result: ---------------- That $int1 and $int2 are assigned the integer values from the first or second line of "filename", respectively. Actual result: -------------- $int1 is assigned correctly, while $int2 was left undefined. It became 0 due to prior initialization, but leaving out optional parameters and dumping the returned associative array would yield $result['int2'] to equal NULL. -- Edit bug report at https://bugs.php.net/bug.php?id=62459&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62459&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62459&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62459&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62459&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62459&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62459&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62459&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62459&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62459&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62459&r=support Expected behavior: https://bugs.php.net/fix.php?id=62459&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62459&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62459&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62459&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62459&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62459&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62459&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62459&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62459&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62459&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62459&r=mysqlcfg

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