Edit report at https://bugs.php.net/bug.php?id=61671&edit=1

 ID:                 61671
 Comment by:         mattfic...@php.net
 Reported by:        a...@php.net
 Summary:            ext\spl\tests\fileobject_003.phpt fails
 Status:             Open
 Type:               Bug
 Package:            SPL related
 Operating System:   Windows
 PHP Version:        5.3.10
 Block user comment: N
 Private report:     N

 New Comment:

The patch fixes the bug for me on Windows and Linux on PHP-5.3-rf3d86b3.


Previous Comments:
------------------------------------------------------------------------
[2012-04-18 14:07:55] a...@php.net

The solution was already introduced in 5.4 by Etienne Kneuss but wasn't merged 
back into 5.3 . SplFileObject should not be used with directories. The patch is 
just putting together all the necessary pieces from 5.4

------------------------------------------------------------------------
[2012-04-18 14:05:06] a...@php.net

The following patch has been added/updated:

Patch Name: 61671.diff
Revision:   1334757906
URL:        
https://bugs.php.net/patch-display.php?bug=61671&patch=61671.diff&revision=1334757906

------------------------------------------------------------------------
[2012-04-17 10:06:34] a...@php.net

A simple reproduce case for this:

C:\php-sdk\php53\vc9\x86\php-src>Debug_TS\php -r "$o = new 
SplFileObject('C:\\php-sdk\\');"

Fatal error: Uncaught exception 'RuntimeException' with message 
'SplFileObject::__construct(C:\php-sdk\): failed to open stream: No such file or
directory' in Command line code:1
Stack trace:
#0 Command line code(1): SplFileObject->__construct('C:\php-sdk\')
#1 {main}
  thrown in Command line code on line 1

------------------------------------------------------------------------
[2012-04-08 11:49:30] a...@php.net

On windows SplFileObject doesn't work as expected with directories,
because the functionality of php_stream_open_wrapper_ex can't open
dir streams on windows. Fixing this may have long range consequences
but would be rather correct instead of just fixing the test behaviour.

------------------------------------------------------------------------
[2012-04-08 11:48:10] a...@php.net

Description:
------------
Test diff:

043+
044+ Fatal error: Uncaught exception 'RuntimeException' with message 
'SplFileObject::__construct(C:\php-sdk\php53\vc9\x86\php-src\ext\spl\tests/): 
failed to open stream: No such file or directory' in 
C:\php-sdk\php53\vc9\x86\php-src\ext\spl\tests\fileobject_003.php:18
045+ Stack trace:
046+ #0 C:\php-sdk\php53\vc9\x86\php-src\ext\spl\tests\fileobject_003.php(18): 
SplFileObject->__construct('C:\php-sdk\php5...')
047+ #1 C:\php-sdk\php53\vc9\x86\php-src\ext\spl\tests\fileobject_003.php(35): 
test('C:\php-sdk\php5...', 's', 'l')
048+ #2 {main}
049+   thrown in 
C:\php-sdk\php53\vc9\x86\php-src\ext\spl\tests\fileobject_003.php on line 18
043- %s(%d) "%stests/"
044- string(%d) "%stests"
045- bool(true)
046- string(5) "tests"
047- bool(true)
048- string(%d) "%sspl"
049- bool(true)
050- string(%d) "%stests"
051- string(%d) "tests"
052- string(%d) "%sspl"
053- ===2===
054- object(SplFileInfo)#%d (2) {
055-   ["pathName":"SplFileInfo":private]=>
056-   string(%d) "%s"
057-   ["fileName":"SplFileInfo":private]=>
058-   string(%d) "%s"
059- }
060- object(SplFileInfo)#%d (2) {
061-   ["pathName":"SplFileInfo":private]=>
062-   string(%d) "%s"
063-   ["fileName":"SplFileInfo":private]=>
064-   string(%d) "%s"
065- }
066- bool(false)
067- bool(true)
068- bool(true)
069- %s(%d) "%stests"
070- string(%d) "%stests"
071- bool(true)
072- string(%d) "tests"
073- bool(true)
074- string(%d) "%sspl"
075- bool(true)
076- string(%d) "%stests"
077- string(5) "tests"
078- string(%d) "%sspl"
079- ===DONE===

Expected result:
----------------
test pass

Actual result:
--------------
test fail


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61671&edit=1

Reply via email to