FAQ
Hi,

is there any reason why a temporary file created with SplTempFileObject
isn't accessible by another e.g. SplFileObject instance.

$temp = new SplTempFileObject();
$temp->fwrite('A string');
var_dump($temp->getPathname());

The var_dump call returns always the PHP stream URL php://temp. Why the
method getPathname doesn't return a unique ID in the
URL(php://temp/ertZ789) which references to this temporary file. So it
would be posible to access this temporary file by another e.g.
SplFileObject instance.

For testing purpose this would be a great benefit. With a
SplTempFileObject instance a test fixture could be created in RAM. It
would like a virtual file system for one file.

Greetings
Christian

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedMay 1, '11 at 7:23p
activeMay 1, '11 at 7:23p
posts1
users1
websitephp.net

1 user in discussion

Christian Kaps: 1 post

People

Translate

site design / logo © 2022 Grokbase