mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types Co-authored-by: Gina Peter Banyard <girgias@php.net>
19 lines
360 B
PHP
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)
|