php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53535 fopen on SplFileObject fails on windows
Submitted: 2010-12-13 08:54 UTC Modified: 2010-12-13 12:46 UTC
From: eyalt@php.net Assigned:
Status: Not a bug Package: SPL related
PHP Version: 5.3.4 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: eyalt@php.net
New email:
PHP Version: OS:

 

 [2010-12-13 08:54 UTC] eyalt@php.net
Description:
------------
fopen on SplFileObject seems to fail on windows with an 'Invalid argument' warning.

this bug causes the SplFileObject_fgetcsv_* tests to fail on windows.


It should be noted, that on the other hand:

<?php
$fp = new SplFileObject('fgetcsv.csv', 'w+');
$fp1 = fopen('fgetcsv.csv', 'w+');

does work ok.

Test script:
---------------
<?php
var_dump(fopen('SplFileObject::fgetcsv.csv', 'w+'));

Expected result:
----------------
resource(5) of type (stream)

Actual result:
--------------
Warning: fopen(SplFileObject::fgetcsv.csv): failed to open stream: Invalid argument in C:\inetpub\wwwroot\scrap.php on line 2
bool(false)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-13 12:46 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2010-12-13 12:46 UTC] johannes@php.net
The : is invalid in the file name. Replace it with _ or something else in the test and it should work :-)

http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 11:01:32 2025 UTC