Question: Will `WaitForSingleObject` (or `WaitForMultipleObjects`) cause a context switch when waiting for an event with a timeout time of zero? (`Sleep(0)` will yield a threads time-slice immediately as far as I know.)

Now, regarding `WaitForSingle|MultipleObject` and Event handles. If WaitFor\*Object actually needs to wait, it would obviously yield the rest of its time-slice. However, there are two cases where the API does *not* need to wait:

* Either the event is signalled, in which case it can return with `WAIT_OBJECT_0`
* Or the state of the event doesn't matter as I specified a wait time of zero, in which case it can return immediately, either with `WAIT_OBJECT_0` or `WAIT_TIMEOUT`

Now, given this, will `WaitForSingleObject` cause a thread context switch if a timeout time of zero is supplied?

Answer: 
This is kludgey, but

```
$_MYFILES = array();
foreach(array_keys($_FILES['name']) as $i) { // loop over 0,1,2,3 etc...
   foreach(array_keys($_FILES) as $j) { // loop over 'name', 'size', 'error', etc...
      $_MYFILES[$i][$j] = $_FILES[$j][$i]; // "swap" keys and copy over original array values
   }
}

```
why don't you want to declare new array var and to fill it in desirable format? eg

```
$myarr = array();
foreach ($_FILES as $file) {
  $myarr[] = array($file['name'][0], $file['type'][0], $file['tmp_name'][0], $file['size'][0]);
}

```