File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1396,6 +1396,13 @@ static zend_never_inline void zend_binary_assign_op_typed_ref(zend_reference *re
1396
1396
{
1397
1397
zval z_copy ;
1398
1398
1399
+ /* Make sure that in-place concatenation is used if the LHS is a string. */
1400
+ if (opline -> extended_value == ZEND_CONCAT && Z_TYPE (ref -> val ) == IS_STRING ) {
1401
+ concat_function (& ref -> val , & ref -> val , value );
1402
+ ZEND_ASSERT (Z_TYPE (ref -> val ) == IS_STRING && "Concat should return string" );
1403
+ return ;
1404
+ }
1405
+
1399
1406
zend_binary_op (& z_copy , & ref -> val , value OPLINE_CC );
1400
1407
if (EXPECTED (zend_verify_ref_assignable_zval (ref , & z_copy , EX_USES_STRICT_TYPES ()))) {
1401
1408
zval_ptr_dtor (& ref -> val );
@@ -1409,6 +1416,13 @@ static zend_never_inline void zend_binary_assign_op_typed_prop(zend_property_inf
1409
1416
{
1410
1417
zval z_copy ;
1411
1418
1419
+ /* Make sure that in-place concatenation is used if the LHS is a string. */
1420
+ if (opline -> extended_value == ZEND_CONCAT && Z_TYPE_P (zptr ) == IS_STRING ) {
1421
+ concat_function (zptr , zptr , value );
1422
+ ZEND_ASSERT (Z_TYPE_P (zptr ) == IS_STRING && "Concat should return string" );
1423
+ return ;
1424
+ }
1425
+
1412
1426
zend_binary_op (& z_copy , zptr , value OPLINE_CC );
1413
1427
if (EXPECTED (zend_verify_property_type (prop_info , & z_copy , EX_USES_STRICT_TYPES ()))) {
1414
1428
zval_ptr_dtor (zptr );
You can’t perform that action at this time.
0 commit comments