spl_object_hash

Supported Versions: PHP 5 >= 5.2.0, PHP 7, PHP 8
Return hash id for given object
spl_object_hash(object $object): string
        if (is_string($scope) && ($implementation instanceof Closure || $implementation instanceof Scope)) {

            return static::
$globalScopes[static::class][$scope] = $implementation;

        } elseif (
$scope instanceof Closure) {

            return static::
$globalScopes[static::class][spl_object_hash($scope)] = $scope;

        } elseif (
$scope instanceof Scope) {

            return static::
$globalScopes[static::class][get_class($scope)] = $scope;

        }
        $duplicateFooInstance $manager->instance('foo');

        
$duplicateBarInstance $manager->instance('bar');

        
$this->assertEquals(spl_object_hash($fooInstance), spl_object_hash($duplicateFooInstance));

        
$this->assertEquals(spl_object_hash($barInstance), spl_object_hash($duplicateBarInstance));

    }
        $duplicateFooInstance $manager->instance('foo');

        
$duplicateBarInstance $manager->instance('bar');

        
$this->assertEquals(spl_object_hash($fooInstance), spl_object_hash($duplicateFooInstance));

        
$this->assertEquals(spl_object_hash($barInstance), spl_object_hash($duplicateBarInstance));

    }



    public function 
test_unresolvable_isntances_throw_errors()
        });

        
$result $resolver->resolve('foo');



        
$this->assertEquals(spl_object_hash($result), spl_object_hash($resolver->resolve('foo')));

    }



    public function 
testResolverThrowsExceptionOnUnknownEngine()