diff --git a/src/php-8.1-strftime.php b/src/php-8.1-strftime.php index 14e8038..3f5cea4 100644 --- a/src/php-8.1-strftime.php +++ b/src/php-8.1-strftime.php @@ -179,7 +179,12 @@ function strftime (string $format, $timestamp = null, ?string $locale = null) : '%x' => $intl_formatter, ]; - $out = preg_replace_callback('/(?assertEquals('%', $result, '%%: A literal percentage character ("%")'); + + $result = strftime('%%Y', '20220306 13:02:03'); + $this->assertEquals('%Y', $result, '%%Y: A literal percentage character followed by "Y"'); + + $result = strftime('%%%Y', '20220306 13:02:03'); + $this->assertEquals('%2022', $result, '%%%Y: A literal percentage character followed by the year'); } /**