AOP-PHP / AOP

AOP in PHP
Other
565 stars 95 forks source link

[php5.4] Segmentation fault, in around with pointcut "read class->property" #75

Open Nicolab opened 11 years ago

Nicolab commented 11 years ago

Hello,

I found a segmentation fault : error.log : [Mon Oct 07 02:11:35 2013] [notice] child pid 3507 exit signal Segmentation fault (11)

My context :


  class plop {

    public $attr;

    public function __construct()
    {
        $this->attr = 'initial value';

    }
  }

  aop_add_around('read plop->attr', function($jp){

  });

  $p = new plop(); 

  echo $p->attr; 

Crash on selector "read plop->attr" and "plop->attr".

"Segmentation fault" is only if you forget to execute AopJoinPoint::process() in the advice.

php -v
PHP 5.4.20-1~dotdeb.1 (cli) (built: Sep 21 2013 22:25:21) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans