1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/opcache/tests/opt/assign_op_002.phpt
2024-03-13 21:40:26 +01:00

19 lines
360 B
PHP

--TEST--
ASSIGN_OP 002: Incorrect optimization of ASSIGN_OP may lead to incorrect result (sub assign -> pre dec conversion for null values)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--FILE--
<?php
function foo(?int $a = null) {
$a -= 1;
return $a;
}
var_dump(foo(2));
var_dump(foo(null));
?>
--EXPECT--
int(1)
int(-1)