[php-src] Issue #7936: `ReflectionProperty::setValue()` does implicit conversion using strict types

From: Date: Wed, 12 Jan 2022 17:13:24 +0000
Subject: [php-src] Issue #7936: `ReflectionProperty::setValue()` does implicit conversion using strict types
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238989@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7936 Author: franmomu ### Description The following code: ```php <?php declare(strict_types=1); class Test { public string $property = ''; } $test = new Test(); $refProp = new \ReflectionProperty(Test::class, 'property'); $refProp->setValue($test, 3); var_dump($test->property); ``` Resulted in this output: ``` string(1) "3" ``` But I expected this output instead: ``` Fatal error: Uncaught TypeError: Cannot assign int to property Test::$property of type string ``` Link to 3v4l: https://3v4l.org/m0Te8 ### PHP Version PHP >= 7.4 ### Operating System Any

« previous php.bugs (#238989) next »