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

[Optimization] Switch from eval to create_function #4

Closed
lisachenko opened this issue Sep 4, 2014 · 1 comment
Closed

[Optimization] Switch from eval to create_function #4

lisachenko opened this issue Sep 4, 2014 · 1 comment

Comments

@lisachenko
Copy link
Member

Instead of building closure with eval at https://github.com/lisachenko/php-deal/blob/master/src/PhpDeal/Aspect/ContractCheckerAspect.php#L149:

if (!$invoker) {
    $invoker = function () {
        extract(func_get_arg(0));
        return eval('return ' . func_get_arg(1) . '; ?>');
    };
}

I can use a create_function or even additional cache file with definition of function body to optimize invocation of methods with contracts.

@lisachenko
Copy link
Member Author

create_function is deprecated since 7.2.0, so this approach is no-go anymore.

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

No branches or pull requests

1 participant