Skip to content
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

Issue #2527162: Cannot call global functions that take a method by reference #81

Merged
merged 1 commit into from
Jul 6, 2015
Merged

Conversation

drupol
Copy link
Collaborator

@drupol drupol commented Jul 6, 2015

$Args = array();
foreach($args as $k => &$arg){
$Args[$k] = &$arg;
}
Copy link
Owner

Choose a reason for hiding this comment

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

I have used this hack myself before! 👍 I love it :-D.

Lets use $args_reference though instead of $Args and $key => &$arg.

@@ -43,7 +43,14 @@
class Drupal7 {

public function __call($method, $args) {
return call_user_func_array($method, $args);
// Hack: See http://goo.gl/aM5fra
Copy link
Owner

Choose a reason for hiding this comment

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

Lets have this say something like:

// This is a necessary hack to ensure that things that have been passed by reference continue to being passed by reference. For more information see: ...

Copy link
Owner

Choose a reason for hiding this comment

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

Reason: If I see a module with lots of: // Hack, etc.

I usually decide to not use it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wouldn't call this a "hack", this is a very clever way to do something, but I don't consider this as a hack.

@drupol drupol self-assigned this Jul 6, 2015
@LionsAd LionsAd added RTBM and removed Needs review labels Jul 6, 2015
drupol added a commit that referenced this pull request Jul 6, 2015
Issue #2527162: Cannot call global functions that take a method by reference
@drupol drupol merged commit 3fac162 into LionsAd:7.x-1.x Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants