@@ -22,3 +22,40 @@ function foo(int $a, float $b, $numeric, $numeric2, $number, $positive, $negativ
22
22
assertType ('string&numeric ' , (string )$ negative );
23
23
assertType ("'1' " , (string )$ constantInt );
24
24
}
25
+
26
+ /**
27
+ * @param int|float|numeric-string $numeric
28
+ * @param numeric $numeric2
29
+ * @param number $number
30
+ * @param positive-int $positive
31
+ * @param negative-int $negative
32
+ * @param 1 $constantInt
33
+ */
34
+ function concatEmptyString (int $ a , float $ b , $ numeric , $ numeric2 , $ number , $ positive , $ negative , $ constantInt ): void {
35
+ assertType ('string&numeric ' , '' . $ a );
36
+ assertType ('string&numeric ' , '' . $ b );
37
+ assertType ('string&numeric ' , '' . $ numeric );
38
+ assertType ('string&numeric ' , '' . $ numeric2 );
39
+ assertType ('string&numeric ' , '' . $ number );
40
+ assertType ('string&numeric ' , '' . $ positive );
41
+ assertType ('string&numeric ' , '' . $ negative );
42
+ assertType ("'1' " , '' . $ constantInt );
43
+
44
+ assertType ('string&numeric ' , $ a . '' );
45
+ assertType ('string&numeric ' , $ b . '' );
46
+ assertType ('string&numeric ' , $ numeric . '' );
47
+ assertType ('string&numeric ' , $ numeric2 . '' );
48
+ assertType ('string&numeric ' , $ number . '' );
49
+ assertType ('string&numeric ' , $ positive . '' );
50
+ assertType ('string&numeric ' , $ negative . '' );
51
+ assertType ("'1' " , $ constantInt . '' );
52
+ }
53
+
54
+ function concatAssignEmptyString (int $ i , float $ f ) {
55
+ $ i .= '' ;
56
+ assertType ('string&numeric ' , $ i );
57
+
58
+ $ s = '' ;
59
+ $ s .= $ f ;
60
+ assertType ('string&numeric ' , $ s );
61
+ }
0 commit comments