#46688 [Opn]: Return values differ from 5.3 and are also inconsistent

From: Date: Wed, 26 Nov 2008 17:57:57 +0000
Subject: #46688 [Opn]: Return values differ from 5.3 and are also inconsistent
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-131367@lists.php.net to get a copy of this message
 ID:               46688
 User updated by:  ant@php.net
 Reported By:      ant@php.net
 Status:           Open
 Bug Type:         Filesystem function related
 Operating System: Windows, Linux
 PHP Version:      6CVS-2008-11-26 (snap)
 New Comment:

These have all been marked with an XFAIL section...


Previous Comments:
------------------------------------------------------------------------

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





------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46688&edit=1



Thread (3 messages)

« previous php.bugs (#131367) next »