Skip to content

Commit 1760c38

Browse files
committed
Unneeded?
1 parent e7f0fb2 commit 1760c38

File tree

4 files changed

+15
-54
lines changed

4 files changed

+15
-54
lines changed

Zend/tests/falsetoarray.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ print "[015]\n";
7474
$arr = false;
7575
[$arr[]] = [42];
7676

77+
print "[016]\n";
78+
$arr = [ 0 => [ 0 => false ] ];
79+
$arr[0][0][0][] = 42;
80+
81+
print "[017]\n";
82+
$false = false;
83+
$r42 = 42;
84+
$false[] &= $r42;
85+
7786
?>
7887
--EXPECTF--
7988
[001]
@@ -126,4 +135,10 @@ Destructuring
126135
Deprecated: Automatic conversion of false to array is deprecated in %s
127136
[015]
128137

138+
Deprecated: Automatic conversion of false to array is deprecated in %s
139+
[016]
140+
141+
Deprecated: Automatic conversion of false to array is deprecated in %s
142+
[017]
143+
129144
Deprecated: Automatic conversion of false to array is deprecated in %s

Zend/zend_execute.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,9 +2290,6 @@ static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *
22902290
return;
22912291
}
22922292
}
2293-
if (Z_TYPE_P(container) == IS_FALSE) {
2294-
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
2295-
}
22962293
array_init(container);
22972294
goto fetch_from_array;
22982295
} else {

Zend/zend_vm_def.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,11 +1210,9 @@ ZEND_VM_C_LABEL(assign_dim_op_new_array):
12101210
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
12111211
ZVAL_UNDEFINED_OP1();
12121212
}
1213-
12141213
if (Z_TYPE_P(container) == IS_FALSE) {
12151214
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
12161215
}
1217-
12181216
ZVAL_ARR(container, zend_new_array(8));
12191217
ZEND_VM_C_GOTO(assign_dim_op_new_array);
12201218
} else {
@@ -2606,7 +2604,6 @@ ZEND_VM_C_LABEL(try_assign_dim_array):
26062604
FREE_OP_DATA();
26072605
}
26082606
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
2609-
26102607
if (Z_TYPE_P(object_ptr) == IS_FALSE) {
26112608
zend_error(E_DEPRECATED, "Automatic conversion of false to array is deprecated");
26122609
}

0 commit comments

Comments
 (0)