summaryrefslogtreecommitdiff
path: root/Zend/tests/bug71914.phpt
blob: d7cae342f6870dcfd8d9cf15d95b349cf11414d4 (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
31
32
33
34
35
36
37
38
39
40
--TEST--
Bug #71914 (Reference is lost in "switch")
--FILE--
<?php

function bug(&$value) {
    switch ($value) {
    case "xxxx":
        $value = true;
        break;
    }
}

function returnArray() {
    $array = array();
    $array["str"]  = "xxxx";
    return $array;
}

class Foo {
    public $array = array("str" => "xxxx");
}

function test($arr, &$dummy) {
    bug($arr["str"]);
    var_dump($arr["str"]);
}

$foo = new Foo();
$arr = returnArray();

$array = array("str" => "xxxx");
test($array, $array["str"]);
test($arr, $arr["str"]);
test($foo->array, $foo->array["str"]);
?>
--EXPECT--
bool(true)
bool(true)
bool(true)