1--TEST--
2Timeout within foreach loop
3--SKIPIF--
4<?php
5if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6?>
7--FILE--
8<?php
9
10set_time_limit(1);
11
12foreach (new InfiniteIterator(new ArrayIterator([1])) as $i) {
13}
14
15?>
16never reached here
17--EXPECTF--
18Fatal error: Maximum execution time of 1 second exceeded in %s on line %d
19