mikey179/vfsStream — Issue #26: Weird filemtime behaviour
Author: ludovicchabant
Created: 2011-11-28 07:12:58+00:00
State: open

Create a file, get its last modified time, write new contents, get its last modified time again:

```php
$structure = array(
'ubertest.html' => 'This is a test page.'
);
$root = vfsStream::create($structure);

$mtime = filemtime(vfsStream::url('root/ubertest.html'));
usleep(2000000);
file_put_contents(vfsStream::url('root/ubertest.html'), 'BLAAAAH');
$mtime2 = filemtime(vfsStream::url('root/ubertest.html'));
$mtime3 = $root->getChild('ubertest.html')->filemtime();
```

`$mtime3` will be correct, but `$mtime2` is not (I get the same as `$mtime`). It's as if the time value is cached or something. Looking at vfsStream's code, I can't see any obvious bugs, so I'm wondering if PHP is trying to do something clever behind my back and I need to setup something prior to running this code?