◐ Shell
clean mode source ↗

Add is_list function by duskwuff · Pull Request #4886 · php/php-src

@duskwuff

cmb69

rybakit

TysonAndre

TysonAndre added a commit to TysonAndre/php-src that referenced this pull request

Sep 3, 2020
This function tests if an array contains only sequential integer keys. While
this isn't an official type, this usage is consistent with the community usage
of "list" as an annotation type, cf.
https://psalm.dev/docs/annotating_code/type_syntax/array_types/#lists

Rebased version of php#4886

- Use .stub.php files
- Add opcache constant evaluation when argument is a constant

Co-Authored-By: Tyson Andre <tysonandre775@hotmail.com>
Co-Authored-By: Dusk <dusk@woofle.net>

This was referenced

Sep 3, 2020

@twose twose mentioned this pull request

Sep 4, 2020

TysonAndre added a commit to TysonAndre/php-src that referenced this pull request

Jan 6, 2021
This function tests if an array contains only sequential integer keys. While
list isn't an official type, this usage is consistent with the community usage
of "list" as an annotation type, cf.
https://psalm.dev/docs/annotating_code/type_syntax/array_types/#lists

Rebased and modified version of php#4886

- Use .stub.php files
- Add opcache constant evaluation when argument is a constant
- Change from is_list(mixed $value) to array_is_list(array $array)

RFC: https://wiki.php.net/rfc/is_list

Co-Authored-By: Tyson Andre <tysonandre775@hotmail.com>
Co-Authored-By: Dusk <dusk@woofle.net>

php-pulls pushed a commit that referenced this pull request

Jan 20, 2021
This function tests if an array contains only sequential integer keys. While
list isn't an official type, this usage is consistent with the community usage
of "list" as an annotation type, cf.
https://psalm.dev/docs/annotating_code/type_syntax/array_types/#lists

Rebased and modified version of #4886

- Use .stub.php files
- Add opcache constant evaluation when argument is a constant
- Change from is_list(mixed $value) to array_is_list(array $array)

RFC: https://wiki.php.net/rfc/is_list

Co-Authored-By: Tyson Andre <tysonandre775@hotmail.com>
Co-Authored-By: Dusk <dusk@woofle.net>

Closes GH-6070