1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00
Files
archived-php-src/ext/opcache/tests/opt/dce_010.phpt
T
Nikita Popov dbe2cdd7dc Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix DCE of FREE of COALESCE

Note that this is a non-trivial merge, as opt/coalesce.phpt
regresses with this change. I'll have to see if it can be
improved.
2021-04-08 17:06:40 +02:00

18 lines
213 B
PHP

--TEST--
Incorrect DCE of FREE of COALESCE
--FILE--
<?php
function test(?string $str) {
$str ?? $str = '';
return strlen($str);
}
$foo = 'foo';
$foo .= 'bar';
var_dump(test($foo));
?>
--EXPECT--
int(6)