php-src/Zend/tests/bug71756.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

28 lines
452 B
PHP

--TEST--
Bug #71756 (Call-by-reference widens scope to uninvolved functions when used in switch)
--FILE--
<?php
function a ($option) {
b($option['bla']);
c($option);
var_dump($option);
}
function b (&$string) {
$string = 'changed';
}
function c ($option) {
switch ($option['bla']) {
case 'changed':
$copy = $option;
$copy['bla'] = 'copy';
break;
}
}
a(array('bla' => 'false'));
?>
--EXPECT--
array(1) {
["bla"]=>
string(7) "changed"
}