php-src/Zend/tests/bug79155.phpt
Nikita Popov 2eb33818b6 Fixed bug #79155
Make sure we only unset the NULLABLE flag temporarily for class
resolution, as the same type may be compiled multiple types.
2020-01-23 12:54:14 +01:00

37 lines
511 B
PHP

--TEST--
Bug #79155: Property nullability lost when using multiple property definition
--FILE--
<?php
class Foo {
public ?string $a, $b;
public ?stdClass $c, $d;
}
$t = new Foo;
$t->a = "str";
$t->b = "str";
$t->c = new stdClass;
$t->d = new stdClass;
var_dump($t->a, $t->b, $t->c, $t->d);
$t->a = null;
$t->b = null;
$t->c = null;
$t->d = null;
var_dump($t->a, $t->b, $t->c, $t->d);
?>
--EXPECT--
string(3) "str"
string(3) "str"
object(stdClass)#2 (0) {
}
object(stdClass)#3 (0) {
}
NULL
NULL
NULL
NULL