php-src/ext/spl/tests/SplTempFileObject_constructor_maxmemory_basic.phpt
Nikita Popov 9602db3b4a Fix open_mode for SplTempFileObject
open_mode was initialized to "wb", but the length set only to 1.
The effect of this was that the stream is opened using "wb", but
we only report "w".

Fix the length to report the actually used open_mode.
2021-05-07 11:18:51 +02:00

19 lines
531 B
PHP

--TEST--
SPL SplTempFileObject constructor sets correct values when passed fixed memory size
--FILE--
<?php
var_dump(new SplTempFileObject(1024));
?>
--EXPECT--
object(SplTempFileObject)#1 (5) {
["pathName":"SplFileInfo":private]=>
string(25) "php://temp/maxmemory:1024"
["fileName":"SplFileInfo":private]=>
string(25) "php://temp/maxmemory:1024"
["openMode":"SplFileObject":private]=>
string(2) "wb"
["delimiter":"SplFileObject":private]=>
string(1) ","
["enclosure":"SplFileObject":private]=>
string(1) """
}