Skip to content

Commit a1e9dd4

Browse files
committed
fix test case
1 parent dabc7c5 commit a1e9dd4

File tree

1 file changed

+64
-26
lines changed

1 file changed

+64
-26
lines changed

Zend/tests/falsetoarray.phpt

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,89 +3,127 @@ Autovivification of false to array
33
--FILE--
44
<?php
55

6-
// no
6+
// control
77
$undef[] = 42;
88

9-
// no
9+
// control
1010
$null = null;
1111
$null[] = 42;
1212

13-
// yes
13+
// control
14+
$false = false;
15+
$false = [42];
16+
17+
print "[001]\n";
1418
$false = false;
1519
$false[] = 42;
1620

17-
// yes
21+
print "[002]\n";
1822
$ref = false;
1923
$ref2 = &$ref;
2024
$ref2[] = 42;
2125

22-
echo "now function\n";
26+
echo "\nFunction\n";
2327
function ffalse(bool $a, ?bool $b, &$c, ...$d) {
24-
// yes
28+
print "[003]\n";
2529
$a[] = 42;
26-
// yes
30+
print "[004]\n";
2731
$b[] = 42;
28-
// yes
32+
print "[005]\n";
2933
$c[] = 42;
30-
// yes
34+
print "[006]\n";
3135
$d[0][] = 42;
3236
}
3337
$ref = false;
3438
ffalse(false, false, $ref, false);
3539

36-
echo "now class\n";
40+
echo "\nProperties\n";
3741
class Cfalse {
3842
public $def;
3943
private $untyped = false;
4044
static private $st = false;
4145
static private $st2 = false;
4246
static private $st3 = false;
4347
public function __construct(public $pu, private $pr = false) {
44-
// yes
48+
print "[007]\n";
4549
$this->def = false;
4650
$this->def[] = 42;
47-
// yes
51+
print "[008]\n";
4852
$this->untyped[] = 42;
49-
// yes
53+
print "[009]\n";
5054
self::$st[] = 42;
51-
// yes
55+
print "[010]\n";
5256
static::$st2[] = 42;
53-
// yes
57+
print "[011]\n";
5458
$this::$st3[] = 42;
55-
// yes
59+
print "[012]\n";
5660
$this->pu[] = 42;
57-
// yes
61+
print "[013]\n";
5862
$this->pr[] = 42;
5963
}
6064
}
6165
new Cfalse(false, false);
6266

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+
6377
?>
6478
--EXPECTF--
79+
[001]
80+
6581
Deprecated: Automatic conversion of false to array is deprecated in %s
82+
[002]
6683

6784
Deprecated: Automatic conversion of false to array is deprecated in %s
68-
now function
85+
86+
Function
87+
[003]
6988

7089
Deprecated: Automatic conversion of false to array is deprecated in %s
90+
[004]
7191

7292
Deprecated: Automatic conversion of false to array is deprecated in %s
93+
[005]
7394

7495
Deprecated: Automatic conversion of false to array is deprecated in %s
96+
[006]
7597

7698
Deprecated: Automatic conversion of false to array is deprecated in %s
77-
now class
7899

79-
Deprecated: Automatic conversion of false to array is deprecated in %s on line 43
100+
Properties
101+
[007]
80102

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]
82105

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]
84108

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]
86111

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]
88120

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]
90128

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

Comments
 (0)