mirror of
https://github.com/php/php-src.git
synced 2026-04-28 18:53:33 +02:00
dbe2cdd7dc
* 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.
18 lines
213 B
PHP
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)
|