phan / phan/phan

Support php 8.0 printf() family changes for %h/%H/%.*

Open
#4,129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
5.6k
Forks
365
Avg merge
1h 25m
Merged PRs (30d)
6

Description

Parse them in PrintfCheckerPlugin and ConversionSpec. Emit compatibility warnings about support for versions before php 8.

  . printf() and friends now support the %h and %H format specifiers. These
    are the same as %g and %G, but always use "." as the decimal separator,
    rather than determining it through the LC_NUMERIC locale.
  . 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:

        printf("%.*H", (int) ini_get("precision"), $float);
        printf("%.*H", (int) ini_get("serialize_precision"), $float);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading PrintfCheckerPlugin and ConversionSpec to trace how printf() format specifiers, width, and precision are parsed. Implement support for %h, %H, and * width or precision, then add compatibility warnings for PHP versions before 8.0; done means all listed forms are recognized and warnings are emitted where required.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.