Commit 8cb0b5e83cb for php

commit 8cb0b5e83cba7be4f42b6343980acdda62697611
Author: Hans Krentel (hakre) <hanskrentel@yahoo.de>
Date:   Wed Apr 9 12:40:18 2025 +0200

    Make timezone and mail tests independent of php.ini (#20031)

    Several tests can fail when php.ini selects a timezone other than UTC or
    enables mail.add_x_header, as identified during the flaky-test triage in
    GH-20028 and GH-18286.

    Set UTC explicitly for the DateTime inheritance test and DatePeriod
    fixtures. Disable mail.add_x_header in the mail.cr_lf_mode tests so their
    line-ending counts do not include the optional header.

    Closes #20031

diff --git a/Zend/tests/inheritance/deprecation_to_exception_during_inheritance_can_be_caught.phpt b/Zend/tests/inheritance/deprecation_to_exception_during_inheritance_can_be_caught.phpt
index 7a59cca70bd..3492888be89 100644
--- a/Zend/tests/inheritance/deprecation_to_exception_during_inheritance_can_be_caught.phpt
+++ b/Zend/tests/inheritance/deprecation_to_exception_during_inheritance_can_be_caught.phpt
@@ -4,6 +4,8 @@
 <?php
 if (getenv('SKIP_PRELOAD')) die('skip Error handler not active during preloading');
 ?>
+--INI--
+date.timezone=UTC
 --FILE--
 <?php

diff --git a/ext/date/tests/multiple_calls_date_period_iterator_current.phpt b/ext/date/tests/multiple_calls_date_period_iterator_current.phpt
index 273f8567879..69f774656a2 100644
--- a/ext/date/tests/multiple_calls_date_period_iterator_current.phpt
+++ b/ext/date/tests/multiple_calls_date_period_iterator_current.phpt
@@ -2,8 +2,8 @@
 Multiple calls to DatePeriod iterator current() leak objects
 --FILE--
 <?php
-$start = new DateTime('2018-12-31 00:00:00');
-$end   = new DateTime('2019-12-31 00:00:00');
+$start = new DateTime('2018-12-31 00:00:00 UTC');
+$end   = new DateTime('2019-12-31 00:00:00 UTC');

 $interval = new DateInterval('P1M');
 $period = new DatePeriod($start, $interval, 1);
diff --git a/ext/standard/tests/mail/gh19188_cr_lf_mode.phpt b/ext/standard/tests/mail/gh19188_cr_lf_mode.phpt
index 15c9aa2aa28..911c2f2e4de 100644
--- a/ext/standard/tests/mail/gh19188_cr_lf_mode.phpt
+++ b/ext/standard/tests/mail/gh19188_cr_lf_mode.phpt
@@ -3,6 +3,7 @@
 --INI--
 sendmail_path={MAIL:gh19188_cr_lf_mode.out}
 mail.cr_lf_mode=crlf
+mail.add_x_header=off
 --FILE--
 <?php

diff --git a/ext/standard/tests/mail/gh19188_lf_mode.phpt b/ext/standard/tests/mail/gh19188_lf_mode.phpt
index bd69cc42b62..4388b91694c 100644
--- a/ext/standard/tests/mail/gh19188_lf_mode.phpt
+++ b/ext/standard/tests/mail/gh19188_lf_mode.phpt
@@ -3,6 +3,7 @@
 --INI--
 sendmail_path={MAIL:gh19188_lf_mode.out}
 mail.cr_lf_mode=lf
+mail.add_x_header=off
 --FILE--
 <?php

diff --git a/ext/standard/tests/mail/gh19188_mixed_mode.phpt b/ext/standard/tests/mail/gh19188_mixed_mode.phpt
index fa5eb63bd4f..508c421520a 100644
--- a/ext/standard/tests/mail/gh19188_mixed_mode.phpt
+++ b/ext/standard/tests/mail/gh19188_mixed_mode.phpt
@@ -3,6 +3,7 @@
 --INI--
 sendmail_path={MAIL:gh19188_mixed_mode.out}
 mail.cr_lf_mode=mixed
+mail.add_x_header=off
 --FILE--
 <?php
 var_dump(mail('user@example.com', 'Test Subject', 'A Message', 'X-Test: mixed'));
diff --git a/ext/standard/tests/mail/gh19188_os_mode_unix.phpt b/ext/standard/tests/mail/gh19188_os_mode_unix.phpt
index b365e3a671b..a403457b966 100644
--- a/ext/standard/tests/mail/gh19188_os_mode_unix.phpt
+++ b/ext/standard/tests/mail/gh19188_os_mode_unix.phpt
@@ -7,6 +7,7 @@
 --INI--
 sendmail_path={MAIL:gh19188_os_mode.out}
 mail.cr_lf_mode=os
+mail.add_x_header=off
 --FILE--
 <?php
 var_dump(mail('user@example.com', 'Test Subject', 'A Message', 'X-Test: os'));