The Wayback Machine - https://web.archive.org/web/20201130094027/https://github.com/AOP-PHP/AOP/issues/91
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

Static property access pointcut does not trigger on a static property read or write join point and advice is not executed #91

Open
tonix-tuft opened this issue Mar 2, 2015 · 0 comments

Comments

@tonix-tuft
Copy link

@tonix-tuft tonix-tuft commented Mar 2, 2015

Hi,

In the following PHP code:

class Developper
{
    public $preferences;    
    public static $staticVar;   
}

aop_add_before('Developper::staticVar', function() { echo "ACCESS"; });

$developer = new Developper();
$developer::$staticVar = "value"; // as of PHP 5.3.0
Developper::$staticVar = "new value";

The expected output should be:

ACCESS
ACCESS

However, the advice doesn't get executed in any of the two cases.

Neither the following code works:

                                             // using '->' instead of '::'
aop_add_before('Developper->staticVar', function() { echo "ACCESS"; });

$developer = new Developper();
$developer::$staticVar = "value"; // as of PHP 5.3.0
Developper::$staticVar = "new value";

Have you encountered this static property access, read, write issue?

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.