Fix TypeError in pattern property validation with integer keys#880
Merged
DannyvdSluijs merged 2 commits intomainfrom Feb 13, 2026
Merged
Fix TypeError in pattern property validation with integer keys#880DannyvdSluijs merged 2 commits intomainfrom
DannyvdSluijs merged 2 commits intomainfrom
Conversation
…erties Co-authored-by: DannyvdSluijs <618940+DannyvdSluijs@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix TypeError in preg_match argument handling
Fix TypeError in pattern property validation with integer keys
Feb 13, 2026
DannyvdSluijs
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PHP 8+ with
strict_typesthrowsTypeError: preg_match(): Argument #2 ($subject) must be of type string, int givenwhen validating schemas withpatternPropertiesagainst data decoded withjson_decode($json, true). Numeric keys (e.g., HTTP status codes200,404in OpenAPI specs) become integers in associative arrays.Changes
ObjectConstraint.php
preg_match()invalidatePatternProperties()PatternPropertiesTest.php
Impact
Resolves validation failures for any schema using
patternPropertieswhen data contains numeric keys. No behavior change for existing string keys.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/0ad2f84130e8fec8655682532e6d39553054831c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/annotations/zipball/253dca476f70808a5aeed3a47cc2cc88c5cab915/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/deprecations/zipball/d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/marc-mabe/php-enum-phpstan/zipball/63d391c16e3a7753bb928f61d1989438ee63eebc/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/marc-mabe/php-enum/zipball/bb426fcdd65c60fb3638ef741e8782508fda7eef/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/WNIO3J /usr/bin/composer install --prefer-dist --no-dev com-sebastianbergit --global } git conf�� github.accesstoken git 73ccd3de053bdb377171d7b6^{commit} --local pull.rebase de/node/bin/git git(http block)https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/5cee1d3dfc2d2aa6599834520911d246f656bcb8/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpspec/prophecy/zipball/7ab965042096282307992f1b9abff020095757f0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a004701b11273a26cd7955a61d67a7f1e525a45a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/comparator/zipball/bc7d8ac2fe1cce229bff9b5fd4efe65918a1ff52/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/diff/zipball/98ff311ca519c3aa73ccd3de053bdb377171d7b6/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/environment/zipball/56932f6049a0482853056ffd617c91ffcc754205/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/exporter/zipball/64cfeaa341951ceb2019d7b98232399d57bb2296/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/global-state/zipball/800689427e3e8cf57a8fe38fcd1d4344c9b2f046/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/ac5b293dba925751b808e02923399fb44ff0d541/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1d439c229e61f244ff1f211e5c99737f90c67def/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/40a4ed114a4aea5afd6df8d0f0c9cd3033097f66/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/69deeb8664f611f156a924154985fbd4911eb36b/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a691211e94ff39a34811abd521c31bd5b305b0bb/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1015741814413c156abb0f53d7db7bbd03c6e858/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/8fe7e75986a9d24b4cceae847314035df7703a5a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/72a7f7674d053d548003b16ff5a106e7e0e06eee/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/18f071c3a29892b037d35e6b20ddf3ea39b42874/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/process/zipball/467bfc56f18f5ef6d5ccb09324d7e988c1c0a98f/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/stopwatch/zipball/fb2c199cf302eb207f8c23e7ee174c1c31a5c004/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/string/zipball/50590a057841fa6bf69d12eceffce3465b9e32cb/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/webmozarts/assert/zipball/ce6a2f100c404b2d32a1dd1270f9b59ad4f57649/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r7M7Nc /usr/bin/composer install --no-interaction(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>TypeError: preg_match(): Argument #2 ($subject) must be of type string, int given</issue_title>
<issue_description>Seen in https://integration.wikimedia.org/ci/job/quibble-for-mediawiki-core-vendor-mysql-php83/4498/consoleFull trying to upgrade to 6.x (note link won't work forever)