Skip to content

Commit 6eafc6c

Browse files
committed
Add skipif for broken strftime %Z
%Z does not work on musl libc. We have decided not work around this using manual expansion because people shouldn't be using strftime anyway. This function is slated for future deprecation.
1 parent b0bee80 commit 6eafc6c

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

ext/date/tests/bug27780.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ foreach ($timezones as $timezone) {
3535
foreach ($timestrings as $timestring) {
3636
$time = strtotime($timestring);
3737

38-
echo $time, strftime(" [%Y-%m-%d %H:%M:%S %Z]", $time), " [$timestring]\n";
38+
echo $time, date(" [Y-m-d H:i:s T]", $time), " [$timestring]\n";
3939
}
4040

4141
echo "\n";

ext/date/tests/bug32555.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Bug #32555 (strtotime("tomorrow") can return false)
33
--SKIPIF--
44
<?php
55
if (substr(PHP_OS, 0, 3) == 'WIN') die('skip strftime uses system TZ');
6+
if (!strftime('%Z')) die('skip strftime does not support %Z');
67
?>
78
--INI--
89
date.timezone=US/Eastern

ext/date/tests/bug33532.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ date.timezone=UTC
66
--SKIPIF--
77
<?php
88
if(PHP_OS == 'Darwin' || defined('PHP_WINDOWS_VERSION_MAJOR')) die("skip strftime uses system TZ on Darwin and Windows");
9+
if (!strftime('%Z')) die('skip strftime does not support %Z');
910
?>
1011
--FILE--
1112
<?php

ext/standard/tests/time/strptime_basic.phpt

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
Test strptime() function : basic functionality
33
--SKIPIF--
44
<?php
5-
if (!function_exists('strptime')) {
6-
die("skip - strptime() function not available in this build");
7-
}
8-
if(PHP_OS == 'Darwin') die("skip - strptime() behaves differently on Darwin");
5+
if (!function_exists('strptime')) {
6+
die("skip - strptime() function not available in this build");
7+
}
8+
if (PHP_OS == 'Darwin') die("skip - strptime() behaves differently on Darwin");
9+
if (!strftime('%Z')) die('skip strftime does not support %Z');
910
?>
1011
--FILE--
1112
<?php

ext/standard/tests/time/strptime_parts.phpt

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
Test strptime() function : basic functionality
33
--SKIPIF--
44
<?php
5-
if (!function_exists('strptime')) {
6-
die("skip - strptime() function not available in this build");
7-
}
5+
if (!function_exists('strptime')) {
6+
die("skip - strptime() function not available in this build");
7+
}
8+
if (!strftime('%Z')) die('skip strftime does not support %Z');
89
?>
910
--FILE--
1011
<?php

0 commit comments

Comments
 (0)