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

process() call in around-advice fails for exception with exceptiontext #83

Open
thomaseizinger opened this issue Feb 12, 2014 · 0 comments

Comments

@thomaseizinger
Copy link

In the following code

<?php
$advice = function (AopJoinPoint $joinpoint) { $joinpoint->process(); };
aop_add_around("*->*()", $advice);
throw new Exception("Exceptiontext");

php fails to throw the exception, because the process() method fails with the following error:

Warning: __construct(): could not obtain parameters for parsing in D:\xampp\htdocs\index.php on line 3

Fatal error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in D:\xampp\htdocs\index.php on line 3

However, this only occurs if there is an exception text. The following code works:

<?php
$advice = function (AopJoinPoint $joinpoint) { $joinpoint->process(); };
aop_add_around("*->*()", $advice);
throw new Exception();

Tested with PHP 5.3.8 on Windows and Linux.

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

No branches or pull requests

1 participant