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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 18:01:28 2024 UTC