Skip to content

Remove all calls to call_user_func() #12520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? lets see
Fixed tickets -
License MIT
Doc PR -

This PR proposes to replace all occurences of call_user_func() by plain PHP. This is one less function call, and one less depth level in the stack. With it, I also propose that we agree on never using call_user_func() in Sf 3.0, since there is always an equivalent faster PHP syntax.

@linaori
Copy link
Contributor

linaori commented Nov 20, 2014

It seems like your php removal from travis is in two pull requests: #12522

I think it fits better in the other PR.

@nicolas-grekas nicolas-grekas force-pushed the no-call-user-func branch 3 times, most recently from a398fe5 to fb43172 Compare November 20, 2014 10:13

call_user_func(array($this->getParameter('baz_class'), 'configureStatic1'), $instance);
$baz[1] = 'configureStatic1';
Copy link
Member

Choose a reason for hiding this comment

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

are you sure that the dumper will dump it this way ? I don't see the update changing the dump. Be careful when updating test fixtures

@nicolas-grekas
Copy link
Member Author

I must withdraw this PR because call_user_func("foo::bar") works where $a = "foo::bar"; $a() do not.
The other PRs for lower branches are OK.

@nicolas-grekas nicolas-grekas deleted the no-call-user-func branch November 21, 2014 19:41
@nicolas-grekas
Copy link
Member Author

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

Successfully merging this pull request may close these issues.

3 participants