You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Hi,
In the following PHP code:
The expected output should be:
However, the advice doesn't get executed in any of the two cases.
Neither the following code works:
Have you encountered this
static property access, read, write
issue?The text was updated successfully, but these errors were encountered: