Bug #69291 [Opn->Asn]: SPL directory tests fail under some conditions

From: Date: Tue, 24 Mar 2015 19:25:45 +0000
Subject: Bug #69291 [Opn->Asn]: SPL directory tests fail under some conditions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191576@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69291&edit=1

 ID:                 69291
 Updated by:         danack@php.net
 Reported by:        danack@php.net
 Summary:            SPL directory tests fail under some conditions
-Status:             Open
+Status:             Assigned
 Type:               Bug
 Package:            SPL related
 Operating System:   Centos
 PHP Version:        5.5.23
-Assigned To:        
+Assigned To:        danack
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2015-03-24 19:25:29] danack@php.net

Description:
------------
The tests ext/spl/tests/dit_004.phpt and ext/spl/tests/dit_005.phpt fail on Centos running in a
VirtualBox VM, but only under certain conditions:

* when they are run through "php run-tests.php ext/spl/tests/dit_004.phpt" - both of them
fail.

* dit_004 fails when run as "valgrind -q --tool=memcheck /usr/bin/php
ext/spl/tests/dit_004.php". dit_005.phpt doesn't fail and works fine.

Both of the tests run as expected when you just run the underlying PHP code that they are calling.

The behaviour is as if the cloned object is jumping to a random entry in the DirectoryIterator

Test script:
---------------
<?php
$a = new DirectoryIterator(__DIR__);
$b = clone $a;

$bValue = (string)$b;
$aValue = (string)$a;
if ($aValue != $bValue) {
	echo "aValue and bValue should be the same".PHP_EOL;
	echo $aValue.PHP_EOL;
	echo $bValue.PHP_EOL;
}
else {
    echo "Ok";
}


Expected result:
----------------
Ok

Actual result:
--------------
aValue and bValue should be the same
.
SplObjectStorage_offsetGet_invalid_parameter.phpt


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



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


Thread (7 messages)

« previous php.bugs (#191576) next »