If this is happening at the CLI level, then I'd say this is a bug in PHP and should be reported (http://bugs.php.net).
Before you do, however, you should take the following steps so they won't yell at you:
Make sure you're running the latest stable version of PHP (5.3.8)!! They'll ask you for the version, and if you're using an older one, they'll probably just mark it bogus and tell you to download the current version.
Repeat the test in Linux using the identical script. The result will tell you whether the bug is specific to the Windows build or not. If it is, it may or may not be a problem with Windows itself (in which case Pierre might get a bit annoyed), but I'd say it's still worth posting so that there's a record of this issue on the bug tracker.
This isn't required, but converting your script to a PHPT file and then posting that might get you a more prompt response.
If possible, try replicating this bug on a separate Windows box so that a problem with your OS configuration can be ruled-out. You can of course skip this step if the bug occurs in Linux as well.
Once the bug is posted, please post a link to it here. You'll probably get responses asking for additional information, so keep an eye on it and be prepared to do so without too much delay.
This process will confirm whether or not it's a bug in PHP. If it is a bug, then your report will lead to a fix in the next release. If a hotfix is posted, I could patch that into the source and send you a custom build to use until the next version is released.
Oh and on an unrelated note, you should not be using the ZTS build of PHP on IIS/FastCGI! I don't think this is related to the problem you're having, but you could run into other problems (performance decline, random crashes, etc) if you continue using that build. What you want is the NTS (non-thread-safe) build.
Here's the basic rule of thumb for running PHP on Windows:
Apache: Thread-safe (ZTS)
IIS ISAPI: Thread-safe (ZTS)
IIS FastCGI: Non-thread-safe (NTS)