8000 Use foreach loop rather than array_map() to invoke do_hook() callbacks by boonebgorges · Pull Request #1208 · wp-cli/wp-cli · GitHub
[go: up one dir, main page]

Skip to content

Use foreach loop rather than array_map() to invoke do_hook() callbacks#1208

Merged
danielbachhuber merged 2 commits intowp-cli:masterfrom
boonebgorges:master
May 14, 2014
Merged

Use foreach loop rather than array_map() to invoke do_hook() callbacks#1208
danielbachhuber merged 2 commits intowp-cli:masterfrom
boonebgorges:master

Conversation

@boonebgorges
Copy link
Contributor

Third-level subcommands (wp bp group get_members) are causing segmentation faults on my setup (wp-cli 0.15.0 or bdd601c; PHP 5.5.12). I traced the problem to WP_CLI::do_hook(), and the following line:

array_map( 'call_user_func', self::$hooks[ $when ] );

Changing to a foreach loop removes the problem.

I tried a bit of research, but couldn't find a root cause (eg on the PHP bug tracker).

See also #1175, #969

array_map( 'call_user_func', $hooks ) causes segmentation faults on PHP 5.5.12.
@danielbachhuber
Copy link
Member

@boonebgorges Can you change .travis.yml to reference PHP 5.5 instead of 5.4 and we can see if this was the original cause of it?

@danielbachhuber danielbachhuber added this to the next milestone May 14, 2014
@boonebgorges
Copy link
Contributor Author

👍

@danielbachhuber
Copy link
Member

🐶

@boonebgorges
Copy link
Contributor Author

💋

danielbachhuber added a commit that referenced this pull request May 14, 2014
Use foreach loop rather than array_map() to invoke do_hook() callbacks
@danielbachhuber danielbachhuber merged commit b23e782 into wp-cli:master May 14, 2014
@danielbachhuber
Copy link
Member

@boonebgorges up for opening a ticket on bugs.php.net? I'd classify this as a genuine bug, and it would be good to see through to its completion.

@danielbachhuber danielbachhuber modified the milestones: 0.15.1, next May 14, 2014
@boonebgorges
Copy link
Contributor Author

Yeah, let me first set up a couple vms to see if I can narrow down the
version where the problem was introduced.

On 05/14/2014 06:42 PM, Daniel Bachhuber wrote:

@boonebgorges https://github.com/boonebgorges up for opening a ticket
on bugs.php.net? I'd classify this as a genuine bug, and it would be
good to see through to its completion.


Reply to this email directly or view it on GitHub
#1208 (comment).

danielbachhuber added a commit that referenced this pull request May 14, 2014
Use foreach loop rather than array_map() to invoke do_hook() callbacks
Conflicts:
	.travis.yml
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.

2 participants

0