Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

reduce arguments by reference #8

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open

reduce arguments by reference #8

wants to merge 15 commits into from

Conversation

marc-mabe
Copy link
Member

This PR reduces arguments by reference often used on internal methods.

It was previously done as performance improvement but in fact it decreases performance as PHP have to create a new zval and in some cases it needs to copy the value before PHP-7 as described here: http://nikic.github.io/2015/05/05/Internal-value-representation-in-PHP-7-part-1.html

Additionally arguments by reference make the code more error prone and hard to read.

@Maks3w
Copy link
Member

Maks3w commented Jun 13, 2015

I'll suggest to open a issue for each idea so we could discuss over each one separately.

@marc-mabe marc-mabe changed the title ZF3 code cleanup ZF3 [WIP] reduce arguments by reference Jun 13, 2015
@marc-mabe
Copy link
Member Author

@Maks3w I have changed the title and description on this PR. Will open new for the other ideas.

@Maks3w
Copy link
Member

Maks3w commented Jun 13, 2015

@marc-mabe Thanks. Tiny objectives make it more easy to be approved and merged.

$this->normalizeKeyValuePairs($keyValuePairs);
$args = new ArrayObject([
$keyValuePairs = $this->normalizeKeyValuePairs($keyValuePairs);
$args = new ArrayObject([
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @weierophinney Is this the kind of cosmetic changes you want?

@marc-mabe marc-mabe added this to the 3.0.0 milestone Oct 30, 2015
@marc-mabe marc-mabe changed the title ZF3 [WIP] reduce arguments by reference reduce arguments by reference Oct 30, 2015
@marc-mabe
Copy link
Member Author

related to #67

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-cache; a new issue has been opened at laminas/laminas-cache#14.

@weierophinney
Copy link
Member

This repository has been moved to laminas/laminas-cache. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:

  • Squash all commits in your branch (git rebase -i origin/{branch})
  • Make a note of all changed files (`git diff --name-only origin/{branch}...HEAD
  • Run the laminas/laminas-migration tool on the code.
  • Clone laminas/laminas-cache to another directory.
  • Copy the files from the second bullet point to the clone of laminas/laminas-cache.
  • In your clone of laminas/laminas-cache, commit the files, push to your fork, and open the new PR.
    We will be providing tooling via laminas/laminas-migration soon to help automate the process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants