php-8.0.30-src/ext/opcache/tests/bug77257.phpt

24 lines
415 B
PHP

--TEST--
Bug #77257: value of variable assigned in a switch() construct gets lost
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
function test($x) {
$a = false;
switch($x["y"]) {
case "a":
$a = true;
break;
case "b":
break;
case "c":
break;
}
return $a;
}
var_dump(test(["y" => "a"]));
?>
--EXPECT--
bool(true)