summaryrefslogtreecommitdiffstats
path: root/7e8816a4be83c43f3a0b373fe3d619dff5bc5fd8.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-12-15 09:12:19 +0100
committerRemi Collet <remi@remirepo.net>2019-12-15 09:12:19 +0100
commit4cf7c27103cdd62893b3bf78065ad1819cf331ad (patch)
treeab21e8ccb15a26507768c7d1094b6be2fce8294b /7e8816a4be83c43f3a0b373fe3d619dff5bc5fd8.patch
parent72eec8064d05740635548e1fa3e15e0206b2e564 (diff)
- add upstream patches for 7.3 and 7.4
- disable ZTS for now
Diffstat (limited to '7e8816a4be83c43f3a0b373fe3d619dff5bc5fd8.patch')
-rw-r--r--7e8816a4be83c43f3a0b373fe3d619dff5bc5fd8.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/7e8816a4be83c43f3a0b373fe3d619dff5bc5fd8.patch b/7e8816a4be83c43f3a0b373fe3d619dff5bc5fd8.patch
new file mode 100644
index 0000000..748c6c9
--- /dev/null
+++ b/7e8816a4be83c43f3a0b373fe3d619dff5bc5fd8.patch
@@ -0,0 +1,35 @@
+From 7e8816a4be83c43f3a0b373fe3d619dff5bc5fd8 Mon Sep 17 00:00:00 2001
+From: USAMI Kenta <tadsan@zonu.me>
+Date: Thu, 11 Jul 2019 18:23:23 +0900
+Subject: [PATCH] Fix return value when DateTimeImmutable::createFromFormat()
+
+---
+ timecop_php7.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/timecop_php7.c b/timecop_php7.c
+index 8d7faec..8493033 100644
+--- a/timecop_php7.c
++++ b/timecop_php7.c
+@@ -1417,7 +1417,7 @@ static void _timecop_date_create_from_format(INTERNAL_FUNCTION_PARAMETERS, int i
+ {
+ zval *orig_timezone = NULL;
+ zval orig_format, orig_time, fixed_format, fixed_time, new_format, new_time;
+- zval dt, now_timestamp, tmp;
++ zval dt, dti, now_timestamp, tmp;
+ char *orig_format_str, *orig_time_str;
+ size_t orig_format_len, orig_time_len;
+ tc_timeval now;
+@@ -1440,6 +1440,12 @@ static void _timecop_date_create_from_format(INTERNAL_FUNCTION_PARAMETERS, int i
+ memchr(orig_format_str, '|', orig_format_len)) {
+ zval_ptr_dtor(&orig_format);
+ zval_ptr_dtor(&orig_time);
++
++ if (immutable) {
++ call_php_method_with_1_params(NULL, TIMECOP_G(ce_DateTimeImmutable), "createfrommutable", &dti, &dt);
++ RETURN_ZVAL(&dti, 1, 1);
++ }
++
+ RETURN_ZVAL(&dt, 1, 1);
+ }
+