Doc #62459 [Opn->Csd]: [DE] Missing hint for fscanf

From: Date: Fri, 06 Jul 2012 22:09:06 +0000
Subject: Doc #62459 [Opn->Csd]: [DE] Missing hint for fscanf
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8539@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62459&edit=1 ID: 62459 Updated by: nikic@php.net Reported by: roman dot matzutt at rwth-aachen dot de Summary: [DE] Missing hint for fscanf -Status: Open +Status: Closed Type: Documentation Problem Package: Translation problem Operating System: Linux PHP Version: Irrelevant -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2012-07-06 22:07:46] nikic@php.net Automatic comment from SVN on behalf of nikic Revision: http://svn.php.net/viewvc/?view=revision&revision=326508 Log: Fix Doc Bug #62459 [DE] Missing hint for fscanf ------------------------------------------------------------------------ [2012-07-01 16:47:26] roman dot matzutt at rwth-aachen dot de 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 this bug report at https://bugs.php.net/bug.php?id=62459&edit=1

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