eval.in

Paste #32581

PHP — PHP 5.4.6, pasted 10 months ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
$search_tags = array(
		"happy",
		"summer",
		"beach",
		"glasses",
		"umbrella",
		"funny",
		"people",
		"music",
		"rap"
);

$accounts = array(
		"account A",
		"account B",
		"account C"
);

$accounts = new InfiniteIterator(new ArrayIterator($accounts));
$accounts->rewind();

foreach($search_tags as $tag) {
	echo ucfirst($accounts->current()), PHP_EOL;
	$accounts->next();
}

?>

Program Output

Account A
Account B
Account C
Account A
Account B
Account C
Account A
Account B
Account C

OK (0.008 sec real, 0.010 sec wall, 13 MB, 59 syscalls)

Fork