php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46688 Return values differ from 5.3 and are also inconsistent
Submitted: 2008-11-26 17:56 UTC Modified: 2010-06-21 02:14 UTC
From: ant@php.net Assigned:
Status: Wont fix Package: Filesystem function related
PHP Version: 6CVS-2008-11-26 (snap) OS: *
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
24 + 36 = ?
Subscribe to this entry?

 
 [2008-11-26 17:56 UTC] ant@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




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-26 17:57 UTC] ant@php.net
These have all been marked with an XFAIL section...
 [2010-06-21 02:14 UTC] felipe@php.net
-Status: Open +Status: Wont fix
 [2010-06-21 02:14 UTC] felipe@php.net
Old trunk related.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 12 12:01:27 2024 UTC