Skip to content

array_reverse should actually reverse the return type's values #7278

@gnutix

Description

@gnutix

Feature request

Hello there. While adding some types and types' tests for a wrapper function around array_reverse() in our codebase, I noticed that the return type was exactly the same as the input's. And as PHPStan can be very precise and output the actual values, it then looks very wrong : https://phpstan.org/r/2bdb4887-5633-4f5d-9ba4-a3f20252ffed

I guess it could be improved upon by writing a dedicated extension ?

(I don't currently have the time to work on an implementation, but maybe someone will.)

Did PHPStan help you today? Did it make you happy in any way?

(I have a bunch of small issues to create, sorry if I don't come up with something new for each of them 🙏 )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions