Skip to content

PHP 8.0: *printf() and related functions support new specifiers #1540

Open
@jrfnl

Description

Is your feature request related to a problem?

PHP 8.0 silently introduced two new placeholder characters for the *printf() range of functions.
This not mentioned in migration guide, changelog etc - I only discovered it by accident via a small note in the manual.

h | Like the g specifier but uses F. Available as of PHP 8.0.0.
H | Like the g specifier but uses E and F. Available as of PHP 8.0.0.

Ref: https://www.php.net/manual/en/function.sprintf.php

Describe the solution you'd like

New sniff in the ParameterValue category to analyze the $format parameter of the relevant functions and flag use of the new modifiers if PHP < 8.0 needs to be supported.

  • I intend to create a pull request to implement this feature.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions