summaryrefslogtreecommitdiffstats
path: root/70fe4e091eadb40a57b90c0d6345b7722b6817db.patch
diff options
context:
space:
mode:
Diffstat (limited to '70fe4e091eadb40a57b90c0d6345b7722b6817db.patch')
-rw-r--r--70fe4e091eadb40a57b90c0d6345b7722b6817db.patch162
1 files changed, 162 insertions, 0 deletions
diff --git a/70fe4e091eadb40a57b90c0d6345b7722b6817db.patch b/70fe4e091eadb40a57b90c0d6345b7722b6817db.patch
new file mode 100644
index 0000000..2e74b59
--- /dev/null
+++ b/70fe4e091eadb40a57b90c0d6345b7722b6817db.patch
@@ -0,0 +1,162 @@
+From 70fe4e091eadb40a57b90c0d6345b7722b6817db Mon Sep 17 00:00:00 2001
+From: Thijs <thijs@305.nl>
+Date: Thu, 29 Aug 2019 16:55:46 +0200
+Subject: [PATCH] Fixed issue with microseconds on php 7.3
+
+---
+ .travis.yml | 1 +
+ tests/date_007.phpt | 2 +-
+ tests/date_008.phpt | 2 +-
+ tests/date_override_007.phpt | 2 +-
+ tests/date_override_008.phpt | 2 +-
+ tests/immutable_007.phpt | 2 +-
+ tests/immutable_008.phpt | 2 +-
+ tests/immutable_override_007.phpt | 2 +-
+ tests/immutable_override_008.phpt | 2 +-
+ timecop_php7.c | 21 +++++++++++++++------
+ 10 files changed, 24 insertions(+), 14 deletions(-)
+
+diff --git a/tests/date_007.phpt b/tests/date_007.phpt
+index fe47ded..db490d8 100644
+--- a/tests/date_007.phpt
++++ b/tests/date_007.phpt
+@@ -58,7 +58,7 @@ string\(32\) "2010-09-02 03:04:05\.000000-07:00"
+ string\(32\) "2010-12-24 03:04:05\.000000-08:00"
+ string\(32\) "2010-01-02 05:00:00\.000000\+09:00"
+ string\(32\) "2010-01-02 00:00:59\.000000-08:00"
+-string\(32\) "2010-01-02 03:04:05\.654321-08:00"
++string\(32\) "2010-01-02 (00|03):(00|04):(00|05)\.654321-08:00"
+ string\(32\) "2012-03-31 12:34:56\.000000-07:00"
+ string\(32\) "1970-01-01 12:34:56\.000000-08:00"
+ string\(32\) "1970-01-01 19:00:00\.000000-05:00"
+diff --git a/tests/date_008.phpt b/tests/date_008.phpt
+index 25ea7b1..851c953 100644
+--- a/tests/date_008.phpt
++++ b/tests/date_008.phpt
+@@ -59,7 +59,7 @@ string\(32\) "2010-09-02 03:04:05\.000000-07:00"
+ string\(32\) "2010-12-24 03:04:05\.000000-08:00"
+ string\(32\) "2010-01-02 05:00:00\.000000\+09:00"
+ string\(32\) "2010-01-02 00:00:59\.000000-08:00"
+-string\(32\) "2010-01-02 03:04:05\.654321-08:00"
++string\(32\) "2010-01-02 (00|03):(00|04):(00|05)\.654321-08:00"
+ string\(32\) "2012-03-31 12:34:56\.000000-07:00"
+ string\(32\) "1970-01-01 12:34:56\.000000-08:00"
+ string\(32\) "1970-01-01 19:00:00\.000000-05:00"
+diff --git a/tests/date_override_007.phpt b/tests/date_override_007.phpt
+index 804a982..6dd8311 100644
+--- a/tests/date_override_007.phpt
++++ b/tests/date_override_007.phpt
+@@ -60,7 +60,7 @@ string\(32\) "2010-09-02 03:04:05\.000000-07:00"
+ string\(32\) "2010-12-24 03:04:05\.000000-08:00"
+ string\(32\) "2010-01-02 05:00:00\.000000\+09:00"
+ string\(32\) "2010-01-02 00:00:59\.000000-08:00"
+-string\(32\) "2010-01-02 03:04:05\.654321-08:00"
++string\(32\) "2010-01-02 (00|03):(00|04):(00|05)\.654321-08:00"
+ string\(32\) "2012-03-31 12:34:56\.000000-07:00"
+ string\(32\) "1970-01-01 12:34:56\.000000-08:00"
+ string\(32\) "1970-01-01 19:00:00\.000000-05:00"
+diff --git a/tests/date_override_008.phpt b/tests/date_override_008.phpt
+index 9002b2f..8d38c04 100644
+--- a/tests/date_override_008.phpt
++++ b/tests/date_override_008.phpt
+@@ -61,7 +61,7 @@ string\(32\) "2010-09-02 03:04:05\.000000-07:00"
+ string\(32\) "2010-12-24 03:04:05\.000000-08:00"
+ string\(32\) "2010-01-02 05:00:00\.000000\+09:00"
+ string\(32\) "2010-01-02 00:00:59\.000000-08:00"
+-string\(32\) "2010-01-02 03:04:05\.654321-08:00"
++string\(32\) "2010-01-02 (00|03):(00|04):(00|05)\.654321-08:00"
+ string\(32\) "2012-03-31 12:34:56\.000000-07:00"
+ string\(32\) "1970-01-01 12:34:56\.000000-08:00"
+ string\(32\) "1970-01-01 19:00:00\.000000-05:00"
+diff --git a/tests/immutable_007.phpt b/tests/immutable_007.phpt
+index 22d2742..3bcf5c0 100644
+--- a/tests/immutable_007.phpt
++++ b/tests/immutable_007.phpt
+@@ -58,7 +58,7 @@ string\(32\) "2010-09-02 03:04:05\.000000-07:00"
+ string\(32\) "2010-12-24 03:04:05\.000000-08:00"
+ string\(32\) "2010-01-02 05:00:00\.000000\+09:00"
+ string\(32\) "2010-01-02 00:00:59\.000000-08:00"
+-string\(32\) "2010-01-02 03:04:05\.654321-08:00"
++string\(32\) "2010-01-02 (00|03):(00|04):(00|05)\.654321-08:00"
+ string\(32\) "2012-03-31 12:34:56\.000000-07:00"
+ string\(32\) "1970-01-01 12:34:56\.000000-08:00"
+ string\(32\) "1970-01-01 19:00:00\.000000-05:00"
+diff --git a/tests/immutable_008.phpt b/tests/immutable_008.phpt
+index fa82837..8fd738f 100644
+--- a/tests/immutable_008.phpt
++++ b/tests/immutable_008.phpt
+@@ -59,7 +59,7 @@ string\(32\) "2010-09-02 03:04:05\.000000-07:00"
+ string\(32\) "2010-12-24 03:04:05\.000000-08:00"
+ string\(32\) "2010-01-02 05:00:00\.000000\+09:00"
+ string\(32\) "2010-01-02 00:00:59\.000000-08:00"
+-string\(32\) "2010-01-02 03:04:05\.654321-08:00"
++string\(32\) "2010-01-02 (00|03):(00|04):(00|05)\.654321-08:00"
+ string\(32\) "2012-03-31 12:34:56\.000000-07:00"
+ string\(32\) "1970-01-01 12:34:56\.000000-08:00"
+ string\(32\) "1970-01-01 19:00:00\.000000-05:00"
+diff --git a/tests/immutable_override_007.phpt b/tests/immutable_override_007.phpt
+index 1bb9992..7d26767 100644
+--- a/tests/immutable_override_007.phpt
++++ b/tests/immutable_override_007.phpt
+@@ -60,7 +60,7 @@ string\(32\) "2010-09-02 03:04:05\.000000-07:00"
+ string\(32\) "2010-12-24 03:04:05\.000000-08:00"
+ string\(32\) "2010-01-02 05:00:00\.000000\+09:00"
+ string\(32\) "2010-01-02 00:00:59\.000000-08:00"
+-string\(32\) "2010-01-02 03:04:05\.654321-08:00"
++string\(32\) "2010-01-02 (00|03):(00|04):(00|05)\.654321-08:00"
+ string\(32\) "2012-03-31 12:34:56\.000000-07:00"
+ string\(32\) "1970-01-01 12:34:56\.000000-08:00"
+ string\(32\) "1970-01-01 19:00:00\.000000-05:00"
+diff --git a/tests/immutable_override_008.phpt b/tests/immutable_override_008.phpt
+index 8ecec38..1c74cc9 100644
+--- a/tests/immutable_override_008.phpt
++++ b/tests/immutable_override_008.phpt
+@@ -61,7 +61,7 @@ string\(32\) "2010-09-02 03:04:05\.000000-07:00"
+ string\(32\) "2010-12-24 03:04:05\.000000-08:00"
+ string\(32\) "2010-01-02 05:00:00\.000000\+09:00"
+ string\(32\) "2010-01-02 00:00:59\.000000-08:00"
+-string\(32\) "2010-01-02 03:04:05\.654321-08:00"
++string\(32\) "2010-01-02 (00|03):(00|04):(00|05)\.654321-08:00"
+ string\(32\) "2012-03-31 12:34:56\.000000-07:00"
+ string\(32\) "1970-01-01 12:34:56\.000000-08:00"
+ string\(32\) "1970-01-01 19:00:00\.000000-05:00"
+diff --git a/timecop_php7.c b/timecop_php7.c
+index 8d7faec..93c51e6 100644
+--- a/timecop_php7.c
++++ b/timecop_php7.c
+@@ -1457,7 +1457,8 @@ static void _timecop_date_create_from_format(INTERNAL_FUNCTION_PARAMETERS, int i
+ memchr(orig_format_str, 'G', orig_format_len) ||
+ memchr(orig_format_str, 'H', orig_format_len) ||
+ memchr(orig_format_str, 'i', orig_format_len) ||
+- memchr(orig_format_str, 's', orig_format_len)) {
++ memchr(orig_format_str, 's', orig_format_len)
++ ) {
+ ZVAL_STRING(&fixed_format, "Y-m-d ??:??:??.??????");
+ } else if (memchr(orig_format_str, 'Y', orig_format_len) ||
+ memchr(orig_format_str, 'y', orig_format_len) ||
+@@ -1471,12 +1472,20 @@ static void _timecop_date_create_from_format(INTERNAL_FUNCTION_PARAMETERS, int i
+ memchr(orig_format_str, 'l', orig_format_len) ||
+ memchr(orig_format_str, 'U', orig_format_len)) {
+ ZVAL_STRING(&fixed_format, "Y-m-d H:i:s.??????");
++ } else if (memchr(orig_format_str, 'u', orig_format_len)) {
++ #if PHP_VERSION_ID >= 70300
++ ZVAL_STRING(&fixed_format, "Y-m-d ??:??:??.??????");
++ #elif PHP_VERSION_ID >= 70100
++ ZVAL_STRING(&fixed_format, "Y-m-d H:i:s.u");
++ #else
++ ZVAL_STRING(&fixed_format, "Y-m-d H:i:s.??????");
++ #endif
+ } else {
+-#if PHP_VERSION_ID >= 70100
+- ZVAL_STRING(&fixed_format, "Y-m-d H:i:s.u");
+-#else
+- ZVAL_STRING(&fixed_format, "Y-m-d H:i:s.??????");
+-#endif
++ #if PHP_VERSION_ID >= 70100
++ ZVAL_STRING(&fixed_format, "Y-m-d H:i:s.u");
++ #else
++ ZVAL_STRING(&fixed_format, "Y-m-d H:i:s.??????");
++ #endif
+ }
+
+ ZVAL_STRING(&tmp, "%s %s");