mirror of
https://github.com/php/php-src.git
synced 2024-10-17 14:32:37 +00:00
31 lines
298 B
Plaintext
31 lines
298 B
Plaintext
|
--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)
|
||
|
}
|