#37257 [Csd]: weird Exception using SplTempFileObject
| From: | judas dot iscariote at gmail dot com | Date: | Mon, 01 May 2006 19:22:15 +0000 |
| Subject: | #37257 [Csd]: weird Exception using SplTempFileObject | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-96451@lists.php.net to get a copy of this message | ||
ID: 37257
User updated by: judas dot iscariote at gmail dot com
Reported By: judas dot iscariote at gmail dot com
Status: Closed
Bug Type: SPL related
Operating System: *
PHP Version: 5.1.3
Assigned To: helly
New Comment:
thanks form fixing this Marcus .. ;)
"Errare Humanum Est"..
It now works as php --rc SPLTempFileObject api docs says.
will be nice if you can provide other kind of documentation in the
future, this class is very useful.
Previous Comments:
------------------------------------------------------------------------
[2006-05-01 16:03:50] helly@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
There was some missing code in ext standard. I was sure to MFH it [...]
to bad you figured this out 1 week to late for 5.1.3.
------------------------------------------------------------------------
[2006-05-01 06:13:00] judas dot iscariote at gmail dot com
seems to be completely broken. :-(
this :
$foo = new SplTempFileObject();
produces in CLI :
PHP Fatal error: Uncaught exception 'RuntimeException' with message
'SplTempFileObject::__construct(php://temp): failed to open stream:
**Illegal seek**' in Command line code:1
Stack trace:
#0 Command line code(1): SplTempFileObject->__construct()
#1 {main}
thrown in Command line code on line 1
and in the webserver ( apache) produces :
Fatal error: Uncaught exception 'RuntimeException' with message
'SplTempFileObject::__construct(php://temp): failed to open stream:
*******Not a directory*******' in /srv/www/htdocs/temp.php:3 Stack
trace: #0 /srv/www/htdocs/temp.php(3): SplTempFileObject->__construct()
#1 {main} thrown in /srv/www/htdocs/temp.php on line 3
I don't think php://temp (???) wrapper should be detected as a
directory, nor I have produced code to generate an "Illegal seek" ..
;-)
------------------------------------------------------------------------
[2006-05-01 05:48:55] judas dot iscariote at gmail dot com
Description:
------------
an incorrect exception is thrown by SplTempFileObject
Reproduce code:
---------------
php -r '$foo = new SplTempFileObject(1024);'
Expected result:
----------------
not sure, since it's not documented, but I think at least not with
"Success" message..
Actual result:
--------------
PHP Fatal error: Uncaught exception 'RuntimeException' with message
'SplTempFileObject::__construct(php://temp/maxmemory:1024): failed to
open stream: ****Success*****' in Command line code:1
Stack trace:
#0 Command line code(1): SplTempFileObject->__construct(1024)
#1 {main}
thrown in Command line code on line 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37257&edit=1