Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PHP Functions Equals Issue #418

@lonadels

Description

@lonadels

Если передать в метод два разных 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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions