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

PHP Functions Equals Issue #418

Open
lonadels opened this issue Dec 5, 2020 · 0 comments
Open

PHP Functions Equals Issue #418

lonadels opened this issue Dec 5, 2020 · 0 comments

Comments

@lonadels
Copy link

lonadels commented Dec 5, 2020

Если передать в метод два разных callable из класса и сравнить их, то результатом сравнения будет TRUE.
В нормальном PHP при сравнении двух разных методов будет возвращаться FALSE.

Пример кода:

class foo {
    function baz(){
        
    }
    
    function baz2(){
        
    }
    
    function test(callable $a, callable $b){
        var_dump($a == $b);
    }
    
    function __construct(){
        $this->test( [$this, "baz"], [$this, "baz2"] );
    }
}

new foo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant