the following "FOO;" will cause a syntax error. This issue can always be
resolved by choosing an ending label that does not occur within the contents
of the string.
+ . References returned by array and property accesses are now unwrapped as
+ part of the access. This means that it is no longer possible to modify the
+ reference between the access and the use of the accessed value:
+
+ $arr = [1];
+ $ref =& $arr[0];
+ var_dump($arr[0] + ($arr[0] = 2));
+ // Previously: int(4), Now: int(3)
+
+ This makes the behavior of references and non-references consistent. Please
+ note that reading and writing a value inside a single expression remains
+ undefined behavior and may change again in the future.
BCMath:
. All warnings thrown by BCMath functions are now using PHP's error handling.
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
try_array:
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type EXECUTE_DATA_CC);
- ZVAL_COPY(result, retval);
+ ZVAL_COPY_DEREF(result, retval);
return;
} else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
container = Z_REFVAL_P(container);
}
if (t1 & MAY_BE_ARRAY_OF_REF) {
if (opline->opcode == ZEND_FETCH_DIM_R) {
- /* can't be REF because of ZVAL_COPY_DEREF() usage */
+ /* can't be REF because of ZVAL_COPY_DEREF() usage */
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
} else {
tmp |= MAY_BE_REF | MAY_BE_RC1 | MAY_BE_RCN;