summaryrefslogtreecommitdiff
path: root/Zend/tests/dereference_006.phpt
blob: 61a07353a4ce8f408073bfab419a0485483bcaa0 (plain)
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
29
30
--TEST--
Testing array dereference and references
--FILE--
<?php

error_reporting(E_ALL);

function &foo(&$foo) {
	return $foo;
}

$a = array(1);
foo($a)[0] = 2;
var_dump($a);

foo($a)[] = 3;
var_dump($a);

?>
--EXPECT--
array(1) {
  [0]=>
  int(2)
}
array(2) {
  [0]=>
  int(2)
  [1]=>
  int(3)
}