summaryrefslogtreecommitdiff
path: root/tests/lang/foreachLoop.006.phpt
blob: f7563dccd05e9e556f9a612b4cfc0078888cb59a (plain)
1
2
3
4
5
6
7
8
9
10
11
--TEST--
Foreach loop tests - error case: key is a reference.
--FILE--
<?php
$a = array("a","b","c");
foreach ($a as &$k=>$v) {
  var_dump($v);
}
?>
--EXPECTF--
Fatal error: Key element cannot be a reference in %s on line 3