zerkms
zerkms

Reputation: 255005

Php on windows and blocks

My development PC has windows installed. And I've experienced weird php behaviour:

<?php

file_put_contents('c:/q', microtime(1) . "\r\n", FILE_APPEND);

sleep(10);

When I run this script in browser simultaneously in two different tabs I get such results

1294713622.125
1294713632.2188

which obviously is not what I expected, although in CLI everything is fine.

So the question: what can block execution? (session.auto_start is Off)

Upvotes: 2

Views: 203

Answers (2)

meze
meze

Reputation: 15097

The issue is in Firefox. It doesn't run requests simultaneously if the requests headers are identical. The issue disappears if network.http.use-cache is disabled in Firefox's config.

it's a good idea to report this bug to mozilla ;)

Upvotes: 4

Jeff Hubbard
Jeff Hubbard

Reputation: 9902

microtime() returns the current UNIX timestamp in microseconds. You should expect it to return a different result when run twice.

Upvotes: 0

Related Questions