Edit report at http://bugs.php.net/bug.php?id=46688&edit=1
ID: 46688 Updated by: fel...@php.net Reported by: a...@php.net Summary: Return values differ from 5.3 and are also inconsistent -Status: Open +Status: Wont fix Type: Bug Package: Filesystem function related Operating System: * PHP Version: 6CVS-2008-11-26 (snap) New Comment: Old trunk related. Previous Comments: ------------------------------------------------------------------------ [2008-11-26 17:57:57] a...@php.net These have all been marked with an XFAIL section... ------------------------------------------------------------------------ [2008-11-26 17:56:24] a...@php.net Description: ------------ The following tests were all ported from 5.3 and behave differently on 6.0. There are two issues with the test results. Firstly, they return different values from 5.3 - this may not be a problem if 6.0 is actually making them more consistent. However within a given function some invalid arguments return bool(false) and other examples return NULL. Perhaps we should be consistent and always return one or the other? It would make documenting the function easier anyway [:o) ext/standard/tests/file/007_error.phpt ext/standard/tests/file/fgetc_variation2.phpt ext/standard/tests/file/fgets_error.phpt ext/standard/tests/file/fgets_variation2.phpt ext/standard/tests/file/fpassthru_error.phpt ext/standard/tests/file/fpassthru_variation1.phpt ext/standard/tests/file/fseek_ftell_rewind_error1.phpt ext/standard/tests/file/fseek_ftell_rewind_error2.phpt ext/standard/tests/file/fseek_ftell_rewind_error3.phpt ext/standard/tests/file/fseek_variation1.phpt ext/standard/tests/file/fseek_variation2.phpt ext/standard/tests/file/fread_error.phpt ext/standard/tests/file/fwrite_error.phpt ext/standard/tests/file/pclose_variation1.phpt ext/standard/tests/file/umask_variation3 Reproduce code: --------------- Here is an example using fopen() - notice the different return values: *** Testing error conditions for fopen(), fclsoe() & feof() *** Warning: fopen() expects at least 2 parameters, 1 given in %s on line %d bool(false) Warning: fopen() expects at least 2 parameters, 0 given in %s on line %d bool(false) Warning: fclose(): %d is not a valid stream resource in %s on line %d bool(false) Warning: fclose() expects parameter 1 to be resource, Unicode string given in %s on line %d NULL Warning: fclose() expects exactly 1 parameter, 0 given in %s on line %d NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=46688&edit=1