Open
Description
Description
The following code:
<?php
class C {
public int $intProp;
}
$c = new C();
$a = new ArrayObject($c);
$a['intProp'] = [];
var_export($c);
// Alternate snippet that would be an Uncaught TypeError: Cannot assign array to property C::$intProp of type int
// unset($c->intProp);
// $c->intProp = [];
Resulted in this output:
\C::__set_state(array(
'intProp' =>
array (
),
))
But I expected this output instead:
Uncaught TypeError: Cannot assign array to property C::$intProp of type int
Related to #9432
Discovered while reviewing #9354
PHP Version
PHP 7.4+
Operating System
No response