◐ Shell
clean mode source ↗

Add array_is_list(array $array) function (rebased) by TysonAndre · Pull Request #6070 · php/php-src

twose

@twose twose mentioned this pull request

Oct 13, 2020

morrisonlevi

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>

@TysonAndre TysonAndre changed the title Add is_list function (rebased) Add array_is_list(array $array) function (rebased)

Jan 6, 2021

nikic

Totktonada pushed a commit to mikhainin/tarantool-php that referenced this pull request

Apr 11, 2022

Totktonada pushed a commit to tarantool/tarantool-php that referenced this pull request

Apr 11, 2022