Category
stdlib
Problem
PHP 8+ array_key_exists() accepts only array as the second parameter (Z_PARAM_ARRAY). Zend throws TypeError with per-argument naming. This compiler raises LogicException with a build-specific message (array_key_exists() second argument must be an array in this compiler build), breaking instanceof TypeError checks and message parity.
php-src reference
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro-maintainer/array_key_exists_non_array.php
php bin/vm.php test/repro-maintainer/array_key_exists_non_array.php'
Zend: TypeError: array_key_exists(): Argument #2 ($array) must be of type array, C given
This compiler: LogicException: array_key_exists() second argument must be an array in this compiler build
Scope
ext/standard/array_key_exists.php — VM + JIT argument validation
- Match Zend
TypeError wording (#n ($name))
Done when
Links
Category
stdlibProblem
PHP 8+
array_key_exists()accepts onlyarrayas the second parameter (Z_PARAM_ARRAY). Zend throwsTypeErrorwith per-argument naming. This compiler raisesLogicExceptionwith a build-specific message (array_key_exists() second argument must be an array in this compiler build), breakinginstanceof TypeErrorchecks and message parity.php-src reference
ext/standard/array.c—PHP_FUNCTION(array_key_exists)/Z_PARAM_ARRAYRepro
Zend:
TypeError: array_key_exists(): Argument #2 ($array) must be of type array, C givenThis compiler:
LogicException: array_key_exists() second argument must be an array in this compiler buildScope
ext/standard/array_key_exists.php— VM + JIT argument validationTypeErrorwording (#n ($name))Done when
TypeErroron VM./script/ci-fast.sh --filter array_key_existsgreen when tests existLinks