Skip to content

[Backport] array_push(...) calls behaving as '$array[] = ...', $array[] = works faster than invoking functions in PHP#16359

Merged
magento-engcom-team merged 1 commit intomagento:2.1-developfrom
lfluvisotto:2.1-develop-PR-port-16144
Jun 26, 2018
Merged

[Backport] array_push(...) calls behaving as '$array[] = ...', $array[] = works faster than invoking functions in PHP#16359
magento-engcom-team merged 1 commit intomagento:2.1-developfrom
lfluvisotto:2.1-develop-PR-port-16144

Conversation

@lfluvisotto
Copy link
Copy Markdown
Contributor

Original Pull Request

#16144

Description

array_push(...) calls behaving as '$array[] = ...', $array[] = works faster than invoking functions in PHP

See note in PHP documentation:

http://php.net/manual/en/function.array-push.php

Note: If you use array_push() to add one element to the array, it's better to use $array[] = because in that way there is no overhead of calling a function.

…y[] = works faster than invoking functions in PHP
@magento-engcom-team magento-engcom-team added this to the Release: 2.1.15 milestone Jun 23, 2018
@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-2113 has been created to process this Pull Request

@magento-engcom-team magento-engcom-team merged commit 66de2da into magento:2.1-develop Jun 26, 2018
magento-engcom-team pushed a commit that referenced this pull request Jun 26, 2018
… ...', $array[] = works faster than invoking functions in PHP #16359
@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @lfluvisotto. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.1.15 release.

@lfluvisotto lfluvisotto deleted the 2.1-develop-PR-port-16144 branch November 22, 2019 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants