Support * variable width in PrintfCheckerPlugin, warn about compatibility for older minimum_target_php_version
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 5.6k
- Forks
- 365
- Avg merge
- 1h 25m
- Merged PRs (30d)
- 6
Description
<?php
// PhanPluginPrintfNoSpecifiers None of the formatting arguments passed alongside format string "%.*f\n" are used
printf("%.*f\n", 2, M_PI); // 3.14 in php 8.0, 'f' in php 7.4
printf() and friends now support using "*" as width or precision, in which case the width/precision is passed as an argument to printf. This also allows using precision -1 with %g, %G, %h and %H. For example, the following code can be used to reproduce PHP's default floating point formatting:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating PrintfCheckerPlugin and its existing handling of printf format arguments, then inspect how minimum_target_php_version compatibility warnings are represented. Reproduce the shown %.*f behavior on supported PHP versions and add coverage for variable width or precision and the older-target warning; done means valid uses are no longer reported as unused arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100