We're only creating tmp here to compare against the existing
coerced_value. We need to destroy it in all cases.
--- /dev/null
+--TEST--
+Do not leak when assigning to reference set with multiple typed properties with type coercion
+--FILE--
+<?php
+
+class Test {
+ public string $x;
+ public string $y;
+}
+
+$test = new Test;
+$ref = "";
+$test->x =& $ref;
+$test->y =& $ref;
+$val = 42;
+$ref = $val;
+var_dump($ref, $val);
+
+?>
+--EXPECT--
+string(2) "42"
+int(42)
zval_ptr_dtor(&tmp);
goto conflicting_coercion_error;
}
+ zval_ptr_dtor(&tmp);
}
} else {
if (!first_prop) {