bug71914.phpt 632 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Bug #71914 (Reference is lost in "switch")
  3. --FILE--
  4. <?php
  5. function bug(&$value) {
  6. switch ($value) {
  7. case "xxxx":
  8. $value = true;
  9. break;
  10. }
  11. }
  12. function returnArray() {
  13. $array = array();
  14. $array["str"] = "xxxx";
  15. return $array;
  16. }
  17. class Foo {
  18. public $array = array("str" => "xxxx");
  19. }
  20. function test($arr, &$dummy) {
  21. bug($arr["str"]);
  22. var_dump($arr["str"]);
  23. }
  24. $foo = new Foo();
  25. $arr = returnArray();
  26. $array = array("str" => "xxxx");
  27. test($array, $array["str"]);
  28. test($arr, $arr["str"]);
  29. test($foo->array, $foo->array["str"]);
  30. ?>
  31. --EXPECT--
  32. bool(true)
  33. bool(true)
  34. bool(true)