Skip to content

Ds\Set::first() incorrect return typehint #1957

@demyan112rv

Description

@demyan112rv

Summary of a problem or a feature request

I think there was a mistake in the php documentation (http://php.net/manual/en/ds-set.first.php)
Return typehint void for this method is incorrect. It should be like mixed
https://github.com/phpstan/phpstan/blob/master/src/Reflection/SignatureMap/functionMap.php#L2177

I also report a bug on php.net (https://bugs.php.net/bug.php?id=77702)

Code snippet that reproduces the problem

use Ds\Set;

$set = new Ds\Set();
$set->add('foo', 'bar');
var_dump($set->first());

Expected output

No errors

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