bug77257.phpt 390 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #77257: value of variable assigned in a switch() construct gets lost
  3. --EXTENSIONS--
  4. opcache
  5. --FILE--
  6. <?php
  7. function test($x) {
  8. $a = false;
  9. switch($x["y"]) {
  10. case "a":
  11. $a = true;
  12. break;
  13. case "b":
  14. break;
  15. case "c":
  16. break;
  17. }
  18. return $a;
  19. }
  20. var_dump(test(["y" => "a"]));
  21. ?>
  22. --EXPECT--
  23. bool(true)