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

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant