mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
streams: Indicate which argument fails the stream ZPP check
This commit is contained in:
parent
efa9e5fdd0
commit
556e4d9008
27 changed files with 96 additions and 93 deletions
|
@ -112,8 +112,8 @@ array(2) {
|
|||
}
|
||||
string(10) "DATA_ERROR"
|
||||
int(-4)
|
||||
bzread(): supplied resource is not a valid stream resource
|
||||
bzerror(): supplied resource is not a valid stream resource
|
||||
bzerrstr(): supplied resource is not a valid stream resource
|
||||
bzerrno(): supplied resource is not a valid stream resource
|
||||
bzread(): Argument #1 ($bz) must be an open stream resource
|
||||
bzerror(): Argument #1 ($bz) must be an open stream resource
|
||||
bzerrstr(): Argument #1 ($bz) must be an open stream resource
|
||||
bzerrno(): Argument #1 ($bz) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -92,7 +92,7 @@ stream_set_blocking 1
|
|||
|
||||
|
||||
close stream
|
||||
stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource
|
||||
stream_set_blocking TypeError: stream_set_blocking(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
socket_set_block
|
||||
Warning: socket_set_block(): unable to set blocking mode [%d]: An operation was attempted on something that is not a socket in %s on line %d
|
||||
|
@ -103,7 +103,7 @@ Warning: socket_get_option(): Unable to retrieve socket option [%d]: An operatio
|
|||
|
||||
|
||||
close socket
|
||||
stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource
|
||||
stream_set_blocking TypeError: stream_set_blocking(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
socket_set_block Error: socket_set_block(): Argument #1 ($socket) has already been closed
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ stream_set_blocking 1
|
|||
|
||||
|
||||
close stream
|
||||
stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource
|
||||
stream_set_blocking TypeError: stream_set_blocking(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
socket_set_block
|
||||
Warning: socket_set_block(): unable to set blocking mode [%d]: %s in %s on line %d
|
||||
|
@ -105,7 +105,7 @@ Warning: socket_get_option(): Unable to retrieve socket option [%d]: %s in %s on
|
|||
|
||||
|
||||
close socket
|
||||
stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource
|
||||
stream_set_blocking TypeError: stream_set_blocking(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
socket_set_block Error: socket_set_block(): Argument #1 ($socket) has already been closed
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ stream_set_blocking 1
|
|||
|
||||
|
||||
close stream
|
||||
stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource
|
||||
stream_set_blocking TypeError: stream_set_blocking(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
socket_set_block
|
||||
Warning: socket_set_block(): unable to set blocking mode [10038]: %s in %ssocket_import_stream-4-win.php on line %d
|
||||
|
@ -98,7 +98,7 @@ Warning: socket_get_option(): Unable to retrieve socket option [10038]: %s in %s
|
|||
|
||||
|
||||
close socket
|
||||
stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource
|
||||
stream_set_blocking TypeError: stream_set_blocking(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
socket_set_block Error: socket_set_block(): Argument #1 ($socket) has already been closed
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ stream_set_blocking 1
|
|||
|
||||
|
||||
close stream
|
||||
stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource
|
||||
stream_set_blocking TypeError: stream_set_blocking(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
socket_set_block
|
||||
Warning: socket_set_block(): unable to set blocking mode [%d]: %s in %s on line %d
|
||||
|
@ -100,7 +100,7 @@ Warning: socket_get_option(): Unable to retrieve socket option [%d]: %s in %s on
|
|||
|
||||
|
||||
close socket
|
||||
stream_set_blocking TypeError: stream_set_blocking(): supplied resource is not a valid stream resource
|
||||
stream_set_blocking TypeError: stream_set_blocking(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
socket_set_block Error: socket_set_block(): Argument #1 ($socket) has already been closed
|
||||
|
||||
|
|
|
@ -102,8 +102,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'wb' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -111,8 +111,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'wt' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -120,8 +120,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'w+' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -129,8 +129,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'w+b' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -138,8 +138,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'w+t' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -147,8 +147,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'r' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -156,8 +156,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'rb' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -165,8 +165,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'rt' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -174,8 +174,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'r+' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -183,8 +183,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'r+b' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -192,8 +192,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'r+t' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -201,8 +201,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'a' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -210,8 +210,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'ab' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -219,8 +219,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'at' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -228,8 +228,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'a+' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -237,8 +237,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'a+t' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -246,8 +246,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'a+b' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -255,8 +255,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Iteration with mode 'x' --
|
||||
resource(%d) of type (stream)
|
||||
|
@ -264,8 +264,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
resource(%d) of type (Unknown)
|
||||
|
||||
-- Iteration with mode 'xb' --
|
||||
|
@ -274,8 +274,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
resource(%d) of type (Unknown)
|
||||
|
||||
-- Iteration with mode 'xt' --
|
||||
|
@ -284,8 +284,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
resource(%d) of type (Unknown)
|
||||
|
||||
-- Iteration with mode 'x+' --
|
||||
|
@ -294,8 +294,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
resource(%d) of type (Unknown)
|
||||
|
||||
-- Iteration with mode 'x+b' --
|
||||
|
@ -304,8 +304,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
resource(%d) of type (Unknown)
|
||||
|
||||
-- Iteration with mode 'x+t' --
|
||||
|
@ -314,8 +314,8 @@ int(0)
|
|||
bool(false)
|
||||
bool(true)
|
||||
resource(%d) of type (Unknown)
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
resource(%d) of type (Unknown)
|
||||
|
||||
*** Done ***
|
||||
|
|
|
@ -15,6 +15,6 @@ try {
|
|||
echo "\nDone.\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
fread(): supplied resource is not a valid stream resource
|
||||
fread(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
Done.
|
||||
|
|
|
@ -94,5 +94,5 @@ bool(false)
|
|||
*** testing feof after a seek passed the end ***
|
||||
bool(false)
|
||||
*** closing file, testing eof ***
|
||||
feof(): supplied resource is not a valid stream resource
|
||||
feof(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -30,5 +30,5 @@ echo "Done";
|
|||
--EXPECT--
|
||||
*** Testing fgetc() : usage variations ***
|
||||
-- Testing fgetc() with closed handle --
|
||||
fgetc(): supplied resource is not a valid stream resource
|
||||
fgetc(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -35,6 +35,6 @@ echo "Done";
|
|||
--EXPECT--
|
||||
*** Testing fgets() : usage variations ***
|
||||
-- Testing fgets() with closed handle --
|
||||
fgets(): supplied resource is not a valid stream resource
|
||||
fgets(): supplied resource is not a valid stream resource
|
||||
fgets(): Argument #1 ($stream) must be an open stream resource
|
||||
fgets(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -46,7 +46,7 @@ $file = __DIR__."/flock.dat";
|
|||
unlink($file);
|
||||
?>
|
||||
--EXPECT--
|
||||
flock(): supplied resource is not a valid stream resource
|
||||
flock(): Argument #1 ($stream) must be an open stream resource
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
|
|
@ -70,4 +70,4 @@ flock(): Argument #2 ($operation) must be of type int, string given
|
|||
flock(): Argument #2 ($operation) must be of type int, string given
|
||||
--- Iteration 7 ---
|
||||
flock(): Argument #2 ($operation) must be of type int, string given
|
||||
flock(): supplied resource is not a valid stream resource
|
||||
flock(): Argument #1 ($stream) must be an open stream resource
|
||||
|
|
|
@ -20,5 +20,5 @@ echo "Done\n";
|
|||
--EXPECT--
|
||||
*** Testing fseek() : error conditions ***
|
||||
-- Testing fseek() with closed/unset file handle --
|
||||
fseek(): supplied resource is not a valid stream resource
|
||||
fseek(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -20,5 +20,5 @@ echo "Done\n";
|
|||
--EXPECT--
|
||||
*** Testing ftell() : error conditions ***
|
||||
-- Testing ftell with closed/unset file handle --
|
||||
ftell(): supplied resource is not a valid stream resource
|
||||
ftell(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -20,5 +20,5 @@ echo "Done\n";
|
|||
--EXPECT--
|
||||
*** Testing rewind() : error conditions ***
|
||||
-- Testing rewind() with closed/unset file handle --
|
||||
rewind(): supplied resource is not a valid stream resource
|
||||
rewind(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -72,5 +72,5 @@ array(26) {
|
|||
["blocks"]=>
|
||||
int(%i)
|
||||
}
|
||||
fstat(): supplied resource is not a valid stream resource
|
||||
fstat(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -35,6 +35,6 @@ unlink( $filename );
|
|||
|
||||
Initial file size = 36
|
||||
-- Testing ftruncate() with closed/unset file handle --
|
||||
ftruncate(): supplied resource is not a valid stream resource
|
||||
ftruncate(): Argument #1 ($stream) must be an open stream resource
|
||||
int(36)
|
||||
Done
|
||||
|
|
|
@ -17,12 +17,6 @@ var_dump(fwrite($fp, "data", -1));
|
|||
var_dump(fwrite($fp, "data", 100000));
|
||||
fclose($fp);
|
||||
|
||||
try {
|
||||
var_dump(fwrite($fp, "data", -1));
|
||||
} catch (Throwable $e) {
|
||||
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
var_dump(file_get_contents($filename));
|
||||
|
||||
echo "Done\n";
|
||||
|
@ -39,6 +33,5 @@ Notice: fwrite(): Write of 4 bytes failed with errno=9 Bad file descriptor in %s
|
|||
bool(false)
|
||||
int(0)
|
||||
int(4)
|
||||
TypeError: fwrite(): supplied resource is not a valid stream resource
|
||||
string(4) "data"
|
||||
Done
|
||||
|
|
|
@ -40,5 +40,5 @@ unlink( $filename );
|
|||
int(0)
|
||||
int(0)
|
||||
-- Testing fwrite() with closed/unset file handle --
|
||||
fwrite(): supplied resource is not a valid stream resource
|
||||
fwrite(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -44,5 +44,5 @@ bool(false)
|
|||
resource(%d) of type (stream)
|
||||
bool(false)
|
||||
resource(%d) of type (stream-context)
|
||||
stream_supports_lock(): supplied resource is not a valid stream resource
|
||||
stream_supports_lock(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -23,4 +23,4 @@ fwrite($fd, "foo");
|
|||
?>
|
||||
--EXPECTF--
|
||||
Warning: fclose(): %d is not a valid stream resource in %s on line %d
|
||||
fclose(): supplied resource is not a valid stream resource
|
||||
fclose(): Argument #1 ($stream) must be an open stream resource
|
||||
|
|
|
@ -18,4 +18,4 @@ try {
|
|||
--EXPECTF--
|
||||
int(%d)
|
||||
int(%d)
|
||||
fwrite(): supplied resource is not a valid stream resource
|
||||
fwrite(): Argument #1 ($stream) must be an open stream resource
|
||||
|
|
|
@ -19,5 +19,5 @@ echo "Done";
|
|||
*** Testing stream_get_meta_data() : error conditions ***
|
||||
|
||||
-- Testing stream_get_meta_data() function with closed stream resource --
|
||||
stream_get_meta_data(): supplied resource is not a valid stream resource
|
||||
stream_get_meta_data(): Argument #1 ($stream) must be an open stream resource
|
||||
Done
|
||||
|
|
|
@ -39,7 +39,7 @@ echo "Done";
|
|||
*** Testing stream_set_timeout() : error conditions ***
|
||||
|
||||
-- Testing stream_set_timeout() function with a closed socket --
|
||||
stream_set_timeout(): supplied resource is not a valid stream resource
|
||||
stream_set_timeout(): Argument #1 ($stream) must be an open stream resource
|
||||
|
||||
-- Testing stream_set_timeout() function with a stream that does not support timeouts --
|
||||
bool(false)
|
||||
|
|
|
@ -34,6 +34,6 @@ try {
|
|||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
gzread(): supplied resource is not a valid stream resource
|
||||
gzread(): Argument #1 ($stream) must be an open stream resource
|
||||
bool(true)
|
||||
gzread(): supplied resource is not a valid stream resource
|
||||
gzread(): Argument #1 ($stream) must be an open stream resource
|
||||
|
|
|
@ -24,4 +24,4 @@ unlink($filename);
|
|||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
gzeof(): supplied resource is not a valid stream resource
|
||||
gzeof(): Argument #1 ($stream) must be an open stream resource
|
||||
|
|
|
@ -287,11 +287,21 @@ END_EXTERN_C()
|
|||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
static zend_always_inline bool php_stream_zend_parse_arg_into_stream(zval *arg, php_stream **destination_stream_ptr, bool check_null)
|
||||
{
|
||||
static zend_always_inline bool php_stream_zend_parse_arg_into_stream(
|
||||
zval *arg,
|
||||
php_stream **destination_stream_ptr,
|
||||
bool check_null,
|
||||
uint32_t arg_num
|
||||
) {
|
||||
if (EXPECTED(Z_TYPE_P(arg) == IS_RESOURCE)) {
|
||||
*destination_stream_ptr = (php_stream*)zend_fetch_resource2(Z_RES_P(arg), "stream", php_file_le_stream(), php_file_le_pstream());
|
||||
if (UNEXPECTED(*destination_stream_ptr == NULL)) {
|
||||
zend_resource *res = Z_RES_P(arg);
|
||||
/* We do not use zend_fetch_resource2() API,
|
||||
* as we want to be able to specify the argument number in the type error */
|
||||
if (EXPECTED(res->type == php_file_le_stream() || res->type == php_file_le_pstream())) {
|
||||
*destination_stream_ptr = (php_stream*)res->ptr;
|
||||
return true;
|
||||
} else {
|
||||
zend_argument_type_error(arg_num, "must be an open stream resource");
|
||||
return false;
|
||||
}
|
||||
} else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
|
||||
|
@ -304,7 +314,7 @@ static zend_always_inline bool php_stream_zend_parse_arg_into_stream(zval *arg,
|
|||
|
||||
#define PHP_Z_PARAM_STREAM_EX(destination_stream_ptr, check_null) \
|
||||
Z_PARAM_PROLOGUE(0, 0); \
|
||||
if (UNEXPECTED(!php_stream_zend_parse_arg_into_stream(_arg, &destination_stream_ptr, check_null))) { \
|
||||
if (UNEXPECTED(!php_stream_zend_parse_arg_into_stream(_arg, &destination_stream_ptr, check_null, _i))) { \
|
||||
_error_code = ZPP_ERROR_FAILURE; \
|
||||
if (!EG(exception)) { \
|
||||
_expected_type = check_null ? Z_EXPECTED_RESOURCE_OR_NULL : Z_EXPECTED_RESOURCE; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue