Skip to content

Implement sscanf() %[scanset] conversions (#11281) - #11318

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-11281-sscanf-scanset
Jun 24, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-11281-sscanf-scanset

Conversation

@PurHur

@PurHur PurHur commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add %[...] scanset support to VmSscanf (inclusive, negated ^, ranges, field width).
  • php-src reference: ext/standard/formatted_io.c scan_set_conversion.

Closes #11281

Verification

source script/php-env.sh
php test/repro/maintainer_gap_sscanf_scanset.php
php bin/vm.php test/repro/maintainer_gap_sscanf_scanset.php
php bin/vm.php test/compliance/cases/stdlib/sscanf_scanset.phpt
php bin/compile.php -l test/repro/maintainer_gap_sscanf_scanset.php

Output:

array ( 0 => 'abc', )
array ( 0 => 'abc', )
array ( 0 => 'xyz', )

Made with Cursor

Port php-src formatted_io.c scanset parsing: inclusive/negated classes,
ranges, and field-width limits. VM-only in ext/standard/VmSscanf.php.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: sscanf()/fscanf() %[scanset] conversion — rejected, scansets unsupported (ext/standard/formatted_io.c)

1 participant