Skip to content

strftime() usage #91

@PHPGangsta

Description

@PHPGangsta

https://github.com/PhenX/php-font-lib/blob/ca6ad461f032145fff5971b5985e5af9e7fa88d8/src/FontLib/BinaryStream.php#L285

strftime() is mentioned in an RFC to be deprecated in PHP 8.1 and removed in PHP 9 if the voting succeeds:
https://wiki.php.net/rfc/deprecations_php_8_1

strftime() works differently depending on the operating system and the libc version. And it's not thread-safe, according to this discussion:
https://externals.io/message/113657#114966

It looks like this strftime() usage does not use any locale-specific "format parameter strings". And I don't find any calls to setlocale() in the code of php-font-lib. But maybe I'm wrong.

If the output is not locale-specific, a simple
date('Y-m-d H:i:s', $date);
can also be used, or not? Or is there any edge-case that I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions