1--TEST-- 2Type change in pre/post-increment (use-after-free) 3--FILE-- 4<?php 5declare(strict_types=1); 6 7class A { 8 public string $foo; 9} 10 11$o = new A; 12$o->foo = "1" . str_repeat("0", 2); 13try { 14 $x = ++$o->foo; 15} catch (Throwable $e) { 16 echo $e->getMessage() . "\n"; 17} 18var_dump($o->foo); 19try { 20 $x = $o->foo++; 21} catch (Throwable $e) { 22 echo $e->getMessage() . "\n"; 23} 24var_dump($o->foo); 25unset($o); 26?> 27--EXPECT-- 28Cannot assign int to property A::$foo of type string 29string(3) "100" 30Cannot assign int to property A::$foo of type string 31string(3) "100" 32