@@ -3,89 +3,127 @@ Autovivification of false to array
3
3
--FILE--
4
4
<?php
5
5
6
- // no
6
+ // control
7
7
$ undef [] = 42 ;
8
8
9
- // no
9
+ // control
10
10
$ null = null ;
11
11
$ null [] = 42 ;
12
12
13
- // yes
13
+ // control
14
+ $ false = false ;
15
+ $ false = [42 ];
16
+
17
+ print "[001] \n" ;
14
18
$ false = false ;
15
19
$ false [] = 42 ;
16
20
17
- // yes
21
+ print " [002] \n" ;
18
22
$ ref = false ;
19
23
$ ref2 = &$ ref ;
20
24
$ ref2 [] = 42 ;
21
25
22
- echo "now function \n" ;
26
+ echo "\n Function \n" ;
23
27
function ffalse (bool $ a , ?bool $ b , &$ c , ...$ d ) {
24
- // yes
28
+ print " [003] \n" ;
25
29
$ a [] = 42 ;
26
- // yes
30
+ print " [004] \n" ;
27
31
$ b [] = 42 ;
28
- // yes
32
+ print " [005] \n" ;
29
33
$ c [] = 42 ;
30
- // yes
34
+ print " [006] \n" ;
31
35
$ d [0 ][] = 42 ;
32
36
}
33
37
$ ref = false ;
34
38
ffalse (false , false , $ ref , false );
35
39
36
- echo "now class \n" ;
40
+ echo "\n Properties \n" ;
37
41
class Cfalse {
38
42
public $ def ;
39
43
private $ untyped = false ;
40
44
static private $ st = false ;
41
45
static private $ st2 = false ;
42
46
static private $ st3 = false ;
43
47
public function __construct (public $ pu , private $ pr = false ) {
44
- // yes
48
+ print " [007] \n" ;
45
49
$ this ->def = false ;
46
50
$ this ->def [] = 42 ;
47
- // yes
51
+ print " [008] \n" ;
48
52
$ this ->untyped [] = 42 ;
49
- // yes
53
+ print " [009] \n" ;
50
54
self ::$ st [] = 42 ;
51
- // yes
55
+ print " [010] \n" ;
52
56
static ::$ st2 [] = 42 ;
53
- // yes
57
+ print " [011] \n" ;
54
58
$ this ::$ st3 [] = 42 ;
55
- // yes
59
+ print " [012] \n" ;
56
60
$ this ->pu [] = 42 ;
57
- // yes
61
+ print " [013] \n" ;
58
62
$ this ->pr [] = 42 ;
59
63
}
60
64
}
61
65
new Cfalse (false , false );
62
66
67
+ echo "\nDestructuring \n" ;
68
+
69
+ print "[014] \n" ;
70
+ $ add = false ;
71
+ foreach ([42 ] as $ add []);
72
+
73
+ print "[015] \n" ;
74
+ $ arr = false ;
75
+ [$ arr []] = [42 ];
76
+
63
77
?>
64
78
--EXPECTF--
79
+ [001]
80
+
65
81
Deprecated: Automatic conversion of false to array is deprecated in %s
82
+ [002]
66
83
67
84
Deprecated: Automatic conversion of false to array is deprecated in %s
68
- now function
85
+
86
+ Function
87
+ [003]
69
88
70
89
Deprecated: Automatic conversion of false to array is deprecated in %s
90
+ [004]
71
91
72
92
Deprecated: Automatic conversion of false to array is deprecated in %s
93
+ [005]
73
94
74
95
Deprecated: Automatic conversion of false to array is deprecated in %s
96
+ [006]
75
97
76
98
Deprecated: Automatic conversion of false to array is deprecated in %s
77
- now class
78
99
79
- Deprecated: Automatic conversion of false to array is deprecated in %s on line 43
100
+ Properties
101
+ [007]
80
102
81
- Deprecated: Automatic conversion of false to array is deprecated in %s on line 45
103
+ Deprecated: Automatic conversion of false to array is deprecated in %s
104
+ [008]
82
105
83
- Deprecated: Automatic conversion of false to array is deprecated in %s on line 47
106
+ Deprecated: Automatic conversion of false to array is deprecated in %s
107
+ [009]
84
108
85
- Deprecated: Automatic conversion of false to array is deprecated in %s on line 49
109
+ Deprecated: Automatic conversion of false to array is deprecated in %s
110
+ [010]
86
111
87
- Deprecated: Automatic conversion of false to array is deprecated in %s on line 51
112
+ Deprecated: Automatic conversion of false to array is deprecated in %s
113
+ [011]
114
+
115
+ Deprecated: Automatic conversion of false to array is deprecated in %s
116
+ [012]
117
+
118
+ Deprecated: Automatic conversion of false to array is deprecated in %s
119
+ [013]
88
120
89
- Deprecated: Automatic conversion of false to array is deprecated in %s on line 53
121
+ Deprecated: Automatic conversion of false to array is deprecated in %s
122
+
123
+ Destructuring
124
+ [014]
125
+
126
+ Deprecated: Automatic conversion of false to array is deprecated in %s
127
+ [015]
90
128
91
- Deprecated: Automatic conversion of false to array is deprecated in %s on line 55
129
+ Deprecated: Automatic conversion of false to array is deprecated in %s
0 commit comments