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