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

Call to parent with static method fail. #84

Open
stephpy opened this issue May 20, 2014 · 0 comments
Open

Call to parent with static method fail. #84

stephpy opened this issue May 20, 2014 · 0 comments

Comments

@stephpy
Copy link

stephpy commented May 20, 2014

Hi,

I found an issue with aop extension. Part of code to reproduce it easily at home.

<?php

class Foo
{
    public function setBar($bar)
    {
        $this->bar = $bar;
    }
}

class Baz extends Foo
{
    public function setBar($bar)
    {
        return call_user_func_array("parent::setBar", array($bar));
    }
}

$a = new Baz();
$a->setBar(10);

echo "success";

With PHP >= 5.3 +AOP

PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method Foo::setBar() should not be called statically in /Users/stephane/Desktop/toto.php on line 15

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Foo::setBar() should not be called statically in /Users/stephane/Desktop/toto.php on line 15
PHP Fatal error:  Using $this when not in object context in /Users/stephane/Desktop/toto.php on line 7

Fatal error: Using $this when not in object context in /Users/stephane/Desktop/toto.php on line 7

With PHP >= 5.3

success

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