summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorLior Kaplan <kaplanlior@gmail.com>2014-01-11 13:43:40 +0200
committerLior Kaplan <kaplanlior@gmail.com>2014-01-11 13:43:40 +0200
commit650fb41a77b3a24ab4130b05fff243b64b241877 (patch)
treeb64f1cfd733f03ce1db807733ddf87ac8d62a903 /ext
parent5a58c4dae727fbc8bd92770c2708baf9e7688857 (diff)
downloadphp-650fb41a77b3a24ab4130b05fff243b64b241877.tar.gz
Imported Upstream version 5.5.8+dfsgupstream/5.5.8+dfsg
Diffstat (limited to 'ext')
-rw-r--r--ext/date/lib/dow.c12
-rw-r--r--ext/date/lib/interval.c103
-rw-r--r--ext/date/lib/parse_iso_intervals.c4
-rw-r--r--ext/date/lib/parse_iso_intervals.re2
-rw-r--r--ext/date/lib/timelib.h2
-rw-r--r--ext/date/lib/timezonedb.h730
-rw-r--r--ext/date/lib/unixtime2tm.c9
-rw-r--r--ext/date/php_date.c82
-rw-r--r--ext/date/tests/DateTime_format_basic2.phpt2
-rw-r--r--ext/date/tests/DateTime_verify.phpt4
-rw-r--r--ext/date/tests/bug52063.phpt4
-rw-r--r--ext/date/tests/bug53879.phpt16
-rw-r--r--ext/date/tests/bug63391.phpt20
-rw-r--r--ext/date/tests/date_constants.phpt4
-rw-r--r--ext/date/tests/forward-transition-construction.phpt27
-rw-r--r--ext/date/tests/gmdate_variation13.phpt4
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt96
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt48
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt56
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt92
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt58
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt58
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt67
-rw-r--r--ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt399
-rw-r--r--ext/date/tests/strtotime3-64bit.phpt2
-rw-r--r--ext/date/tests/test-parse-from-format.phpt4
-rw-r--r--ext/dom/document.c19
-rw-r--r--ext/dom/tests/bug65196.phpt26
-rw-r--r--ext/exif/exif.c7
-rw-r--r--ext/filter/logical_filters.c2
-rw-r--r--ext/filter/tests/bug53150.phpt4
-rw-r--r--ext/gd/config.m427
-rw-r--r--ext/mysqli/mysqli_nonapi.c2
-rw-r--r--ext/mysqlnd/mysqlnd.c2
-rw-r--r--ext/mysqlnd/mysqlnd.h2
-rw-r--r--ext/opcache/README6
-rw-r--r--ext/opcache/ZendAccelerator.c9
-rw-r--r--ext/opcache/ZendAccelerator.h1
-rw-r--r--ext/opcache/tests/issue0140.phpt43
-rw-r--r--ext/opcache/tests/revalidate_path_01.phpt61
-rw-r--r--ext/opcache/zend_accelerator_module.c6
-rw-r--r--ext/openssl/tests/cve-2013-6420.phpt2
-rw-r--r--ext/openssl/xp_ssl.c4
-rw-r--r--ext/pdo_odbc/odbc_stmt.c5
-rw-r--r--ext/reflection/php_reflection.c66
-rw-r--r--ext/reflection/tests/ReflectionExtension_bug66218.phpt21
-rw-r--r--ext/session/tests/session_name_error.phpt2
-rw-r--r--ext/snmp/snmp.c8
-rw-r--r--ext/soap/soap.c226
-rw-r--r--ext/soap/tests/bugs/bug66112.phpt36
-rw-r--r--ext/soap/tests/bugs/bug66112.wsdl42
-rw-r--r--ext/sockets/config.m421
-rw-r--r--ext/sockets/sockaddr_conv.c6
-rw-r--r--ext/spl/tests/class_implements_variation.phpt10
-rw-r--r--ext/spl/tests/class_uses_variation.phpt10
-rw-r--r--ext/standard/tests/array/each.phptbin9570 -> 9574 bytes
-rw-r--r--ext/standard/tests/class_object/class_exists_variation_001.phpt5
-rw-r--r--ext/standard/tests/class_object/trait_exists_variation_001.phpt5
-rw-r--r--ext/standard/tests/file/007_error.phpt4
-rw-r--r--ext/standard/tests/file/fgetss_error.phpt2
-rw-r--r--ext/standard/tests/file/ftruncate_error.phpt2
-rw-r--r--ext/standard/tests/general_functions/floatval.phpt8
-rw-r--r--ext/standard/tests/general_functions/gettype_settype_basic.phpt32
-rw-r--r--ext/standard/tests/general_functions/print_r.phpt12
-rw-r--r--ext/standard/tests/general_functions/strval.phpt4
-rw-r--r--ext/standard/tests/general_functions/type.phpt8
-rw-r--r--ext/standard/tests/general_functions/var_dump.phpt8
-rw-r--r--ext/standard/tests/mail/bug51604.phpt4
-rw-r--r--ext/standard/tests/mail/mail_basic.phpt6
-rw-r--r--ext/standard/tests/mail/mail_basic2.phpt4
-rw-r--r--ext/standard/tests/mail/mail_basic3.phpt2
-rw-r--r--ext/standard/tests/mail/mail_basic4.phpt2
-rw-r--r--ext/standard/tests/mail/mail_basic5.phpt2
-rw-r--r--ext/standard/tests/mail/mail_basic_alt1-win32.phpt2
-rw-r--r--ext/standard/tests/mail/mail_basic_alt2-win32.phpt2
-rw-r--r--ext/standard/tests/mail/mail_basic_alt3-win32.phpt2
-rw-r--r--ext/standard/tests/mail/mail_basic_alt4-win32.phpt2
-rw-r--r--ext/standard/tests/mail/mail_variation1.phpt2
-rw-r--r--ext/standard/tests/mail/mail_variation2.phpt4
-rw-r--r--ext/standard/tests/mail/mail_variation_alt1-win32.phpt2
-rw-r--r--ext/standard/tests/mail/mail_variation_alt2-win32.phpt2
-rw-r--r--ext/standard/tests/strings/implode1.phptbin5875 -> 5877 bytes
-rw-r--r--ext/xsl/tests/bug49634.phpt105
-rw-r--r--ext/xsl/tests/bug49634.xml1
-rw-r--r--ext/xsl/xsltprocessor.c3
-rw-r--r--ext/zip/php_zip.c2
86 files changed, 1711 insertions, 1109 deletions
diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c
index b6c2d6968..6c296a2ba 100644
--- a/ext/date/lib/dow.c
+++ b/ext/date/lib/dow.c
@@ -25,10 +25,7 @@ static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1
static timelib_sll century_value(timelib_sll j)
{
- timelib_sll i = j - 17;
- timelib_sll c = (4 - i * 2 + (i + 1) / 4) % 7;
-
- return c < 0 ? c + 7 : c;
+ return 6 - (j % 4) * 2;
}
static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso)
@@ -36,11 +33,8 @@ static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_
timelib_sll c1, y1, m1, dow;
/* Only valid for Gregorian calendar, commented out as we don't handle
- * julian calendar. We just return the 'wrong' day of week to be
- * consistent.
- if (y < 1753) {
- return -1;
- } */
+ * Julian calendar. We just return the 'wrong' day of week to be
+ * consistent. */
c1 = century_value(y / 100);
y1 = (y % 100);
m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m];
diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c
index 96867ba2b..dce62f3a2 100644
--- a/ext/date/lib/interval.c
+++ b/ext/date/lib/interval.c
@@ -25,7 +25,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
{
timelib_rel_time *rt;
timelib_time *swp;
- timelib_sll dst_h_corr = 0, dst_m_corr = 0;
+ timelib_sll dst_corr = 0 ,dst_h_corr = 0, dst_m_corr = 0;
timelib_time one_backup, two_backup;
rt = timelib_rel_time_ctor();
@@ -43,8 +43,9 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
&& (strcmp(one->tz_info->name, two->tz_info->name) == 0)
&& (one->z != two->z))
{
- dst_h_corr = (two->z - one->z) / 3600;
- dst_m_corr = ((two->z - one->z) % 3600) / 60;
+ dst_corr = two->z - one->z;
+ dst_h_corr = dst_corr / 3600;
+ dst_m_corr = (dst_corr % 3600) / 60;
}
/* Save old TZ info */
@@ -57,16 +58,108 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
rt->y = two->y - one->y;
rt->m = two->m - one->m;
rt->d = two->d - one->d;
- rt->h = two->h - one->h + dst_h_corr;
- rt->i = two->i - one->i + dst_m_corr;
+ rt->h = two->h - one->h;
+ rt->i = two->i - one->i;
rt->s = two->s - one->s;
+ if (one_backup.dst == 0 && two_backup.dst == 1 && two->sse >= one->sse + 86400 - dst_corr) {
+ rt->h += dst_h_corr;
+ rt->i += dst_m_corr;
+ }
+
rt->days = abs(floor((one->sse - two->sse - (dst_h_corr * 3600) - (dst_m_corr * 60)) / 86400));
timelib_do_rel_normalize(rt->invert ? one : two, rt);
+ /* We need to do this after normalisation otherwise we can't get "24H" */
+ if (one_backup.dst == 1 && two_backup.dst == 0 && two->sse >= one->sse + 86400) {
+ if (two->sse < one->sse + 86400 - dst_corr) {
+ rt->d--;
+ rt->h = 24;
+ } else {
+ rt->h += dst_h_corr;
+ rt->i += dst_m_corr;
+ }
+ }
+
/* Restore old TZ info */
memcpy(one, &one_backup, sizeof(one_backup));
memcpy(two, &two_backup, sizeof(two_backup));
return rt;
}
+
+timelib_time *timelib_add(timelib_time *old_time, timelib_rel_time *interval)
+{
+ int bias = 1;
+ timelib_time *t = timelib_time_clone(old_time);
+
+ if (interval->have_weekday_relative || interval->have_special_relative) {
+ memcpy(&t->relative, interval, sizeof(struct timelib_rel_time));
+ } else {
+ if (interval->invert) {
+ bias = -1;
+ }
+ memset(&t->relative, 0, sizeof(struct timelib_rel_time));
+ t->relative.y = interval->y * bias;
+ t->relative.m = interval->m * bias;
+ t->relative.d = interval->d * bias;
+ t->relative.h = interval->h * bias;
+ t->relative.i = interval->i * bias;
+ t->relative.s = interval->s * bias;
+ }
+ t->have_relative = 1;
+ t->sse_uptodate = 0;
+
+ timelib_update_ts(t, NULL);
+
+// printf("%lld %lld %d\n", old_time->dst, t->dst, (t->sse - old_time->sse));
+ /* Adjust for backwards DST changeover */
+ if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) {
+ t->sse -= old_time->z;
+ t->sse += t->z;
+ }
+
+ timelib_update_from_sse(t);
+ t->have_relative = 0;
+
+ return t;
+}
+
+timelib_time *timelib_sub(timelib_time *old_time, timelib_rel_time *interval)
+{
+ int bias = 1;
+ timelib_time *t = timelib_time_clone(old_time);
+
+ if (interval->invert) {
+ bias = -1;
+ }
+
+ memset(&t->relative, 0, sizeof(struct timelib_rel_time));
+ t->relative.y = 0 - (interval->y * bias);
+ t->relative.m = 0 - (interval->m * bias);
+ t->relative.d = 0 - (interval->d * bias);
+ t->relative.h = 0 - (interval->h * bias);
+ t->relative.i = 0 - (interval->i * bias);
+ t->relative.s = 0 - (interval->s * bias);
+ t->have_relative = 1;
+ t->sse_uptodate = 0;
+
+ timelib_update_ts(t, NULL);
+
+ /* Adjust for backwards DST changeover */
+ if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) {
+ t->sse -= old_time->z;
+ t->sse += t->z;
+ }
+ /* Adjust for forwards DST changeover */
+ if (old_time->dst == 0 && t->dst == 1 && !interval->y && !interval->m && !interval->d ) {
+ t->sse -= old_time->z;
+ t->sse += t->z;
+ }
+
+ timelib_update_from_sse(t);
+
+ t->have_relative = 0;
+
+ return t;
+}
diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c
index fedad043c..e669c855a 100644
--- a/ext/date/lib/parse_iso_intervals.c
+++ b/ext/date/lib/parse_iso_intervals.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sun Mar 31 10:48:17 2013 */
+/* Generated by re2c 0.13.5 on Wed Nov 27 11:14:23 2013 */
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
+----------------------------------------------------------------------+
@@ -380,7 +380,7 @@ yy6:
break;
}
ptr++;
- } while (*ptr);
+ } while (!s->errors->error_count && *ptr);
s->have_period = 1;
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
index e50ab37d3..cbbf8781b 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -348,7 +348,7 @@ isoweek = year4 "-"? "W" weekofyear;
break;
}
ptr++;
- } while (*ptr);
+ } while (!s->errors->error_count && *ptr);
s->have_period = 1;
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index dfb7dc030..3f8e1254e 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -138,5 +138,7 @@ int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double lat,
/* from interval.c */
timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two);
+timelib_time *timelib_add(timelib_time *t, timelib_rel_time *interval);
+timelib_time *timelib_sub(timelib_time *t, timelib_rel_time *interval);
#endif
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
index 91884a935..4a4b04188 100644
--- a/ext/date/lib/timezonedb.h
+++ b/ext/date/lib/timezonedb.h
@@ -232,355 +232,355 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[579] = {
{ "Asia/Aden" , 0x018C91 },
{ "Asia/Almaty" , 0x018CE6 },
{ "Asia/Amman" , 0x018E65 },
- { "Asia/Anadyr" , 0x019037 },
- { "Asia/Aqtau" , 0x01921C },
- { "Asia/Aqtobe" , 0x01941B },
- { "Asia/Ashgabat" , 0x0195D3 },
- { "Asia/Ashkhabad" , 0x0196F0 },
- { "Asia/Baghdad" , 0x01980D },
- { "Asia/Bahrain" , 0x019982 },
- { "Asia/Baku" , 0x0199E8 },
- { "Asia/Bangkok" , 0x019CD0 },
- { "Asia/Beirut" , 0x019D25 },
- { "Asia/Bishkek" , 0x01A032 },
- { "Asia/Brunei" , 0x01A1DE },
- { "Asia/Calcutta" , 0x01A240 },
- { "Asia/Choibalsan" , 0x01A2B9 },
- { "Asia/Chongqing" , 0x01A432 },
- { "Asia/Chungking" , 0x01A521 },
- { "Asia/Colombo" , 0x01A5D0 },
- { "Asia/Dacca" , 0x01A66C },
- { "Asia/Damascus" , 0x01A712 },
- { "Asia/Dhaka" , 0x01AA62 },
- { "Asia/Dili" , 0x01AB08 },
- { "Asia/Dubai" , 0x01AB92 },
- { "Asia/Dushanbe" , 0x01ABE7 },
- { "Asia/Gaza" , 0x01ACEA },
- { "Asia/Harbin" , 0x01B03D },
- { "Asia/Hebron" , 0x01B124 },
- { "Asia/Ho_Chi_Minh" , 0x01B480 },
- { "Asia/Hong_Kong" , 0x01B4F8 },
- { "Asia/Hovd" , 0x01B6BA },
- { "Asia/Irkutsk" , 0x01B832 },
- { "Asia/Istanbul" , 0x01BA18 },
- { "Asia/Jakarta" , 0x01BE05 },
- { "Asia/Jayapura" , 0x01BEAF },
- { "Asia/Jerusalem" , 0x01BF4B },
- { "Asia/Kabul" , 0x01C27A },
- { "Asia/Kamchatka" , 0x01C2CB },
- { "Asia/Karachi" , 0x01C4A7 },
- { "Asia/Kashgar" , 0x01C55C },
- { "Asia/Kathmandu" , 0x01C62D },
- { "Asia/Katmandu" , 0x01C693 },
- { "Asia/Khandyga" , 0x01C6F9 },
- { "Asia/Kolkata" , 0x01C91E },
- { "Asia/Krasnoyarsk" , 0x01C997 },
- { "Asia/Kuala_Lumpur" , 0x01CB7F },
- { "Asia/Kuching" , 0x01CC3C },
- { "Asia/Kuwait" , 0x01CD2A },
- { "Asia/Macao" , 0x01CD7F },
- { "Asia/Macau" , 0x01CEBA },
- { "Asia/Magadan" , 0x01CFF5 },
- { "Asia/Makassar" , 0x01D1D7 },
- { "Asia/Manila" , 0x01D29C },
- { "Asia/Muscat" , 0x01D321 },
- { "Asia/Nicosia" , 0x01D376 },
- { "Asia/Novokuznetsk" , 0x01D65E },
- { "Asia/Novosibirsk" , 0x01D860 },
- { "Asia/Omsk" , 0x01DA4B },
- { "Asia/Oral" , 0x01DC32 },
- { "Asia/Phnom_Penh" , 0x01DE02 },
- { "Asia/Pontianak" , 0x01DE7A },
- { "Asia/Pyongyang" , 0x01DF3C },
- { "Asia/Qatar" , 0x01DFA9 },
- { "Asia/Qyzylorda" , 0x01E00F },
- { "Asia/Rangoon" , 0x01E1E5 },
- { "Asia/Riyadh" , 0x01E25D },
- { "Asia/Saigon" , 0x01E2B2 },
- { "Asia/Sakhalin" , 0x01E32A },
- { "Asia/Samarkand" , 0x01E521 },
- { "Asia/Seoul" , 0x01E657 },
- { "Asia/Shanghai" , 0x01E6FB },
- { "Asia/Singapore" , 0x01E7DB },
- { "Asia/Taipei" , 0x01E892 },
- { "Asia/Tashkent" , 0x01E9AA },
- { "Asia/Tbilisi" , 0x01EADB },
- { "Asia/Tehran" , 0x01EC95 },
- { "Asia/Tel_Aviv" , 0x01EF03 },
- { "Asia/Thimbu" , 0x01F232 },
- { "Asia/Thimphu" , 0x01F298 },
- { "Asia/Tokyo" , 0x01F2FE },
- { "Asia/Ujung_Pandang" , 0x01F387 },
- { "Asia/Ulaanbaatar" , 0x01F404 },
- { "Asia/Ulan_Bator" , 0x01F55F },
- { "Asia/Urumqi" , 0x01F6AC },
- { "Asia/Ust-Nera" , 0x01F773 },
- { "Asia/Vientiane" , 0x01F978 },
- { "Asia/Vladivostok" , 0x01F9F0 },
- { "Asia/Yakutsk" , 0x01FBDC },
- { "Asia/Yekaterinburg" , 0x01FDC1 },
- { "Asia/Yerevan" , 0x01FFCC },
- { "Atlantic/Azores" , 0x0201CC },
- { "Atlantic/Bermuda" , 0x0206CF },
- { "Atlantic/Canary" , 0x0209B0 },
- { "Atlantic/Cape_Verde" , 0x020C86 },
- { "Atlantic/Faeroe" , 0x020CFF },
- { "Atlantic/Faroe" , 0x020FA3 },
- { "Atlantic/Jan_Mayen" , 0x021247 },
- { "Atlantic/Madeira" , 0x021579 },
- { "Atlantic/Reykjavik" , 0x021A82 },
- { "Atlantic/South_Georgia" , 0x021C3B },
- { "Atlantic/St_Helena" , 0x021E4D },
- { "Atlantic/Stanley" , 0x021C7F },
- { "Australia/ACT" , 0x021EA2 },
- { "Australia/Adelaide" , 0x0221BF },
- { "Australia/Brisbane" , 0x0224EB },
- { "Australia/Broken_Hill" , 0x0225B2 },
- { "Australia/Canberra" , 0x0228F0 },
- { "Australia/Currie" , 0x022C0D },
- { "Australia/Darwin" , 0x022F40 },
- { "Australia/Eucla" , 0x022FC6 },
- { "Australia/Hobart" , 0x02309B },
- { "Australia/LHI" , 0x0233F9 },
- { "Australia/Lindeman" , 0x023694 },
- { "Australia/Lord_Howe" , 0x023775 },
- { "Australia/Melbourne" , 0x023A20 },
- { "Australia/North" , 0x023D45 },
- { "Australia/NSW" , 0x023DB9 },
- { "Australia/Perth" , 0x0240D6 },
- { "Australia/Queensland" , 0x0241AE },
- { "Australia/South" , 0x02425A },
- { "Australia/Sydney" , 0x024577 },
- { "Australia/Tasmania" , 0x0248B4 },
- { "Australia/Victoria" , 0x024BF9 },
- { "Australia/West" , 0x024F16 },
- { "Australia/Yancowinna" , 0x024FCC },
- { "Brazil/Acre" , 0x0252EE },
- { "Brazil/DeNoronha" , 0x0253F2 },
- { "Brazil/East" , 0x025512 },
- { "Brazil/West" , 0x0257EF },
- { "Canada/Atlantic" , 0x0258E7 },
- { "Canada/Central" , 0x025DCF },
- { "Canada/East-Saskatchewan" , 0x0266D9 },
- { "Canada/Eastern" , 0x0261E9 },
- { "Canada/Mountain" , 0x026862 },
- { "Canada/Newfoundland" , 0x026BD8 },
- { "Canada/Pacific" , 0x027103 },
- { "Canada/Saskatchewan" , 0x02751C },
- { "Canada/Yukon" , 0x0276A5 },
- { "CET" , 0x0279A8 },
- { "Chile/Continental" , 0x027CB1 },
- { "Chile/EasterIsland" , 0x02804C },
- { "CST6CDT" , 0x02838E },
- { "Cuba" , 0x0286DF },
- { "EET" , 0x028A52 },
- { "Egypt" , 0x028D05 },
- { "Eire" , 0x028FC8 },
- { "EST" , 0x0294D9 },
- { "EST5EDT" , 0x02951D },
- { "Etc/GMT" , 0x02986E },
- { "Etc/GMT+0" , 0x02993A },
- { "Etc/GMT+1" , 0x0299C4 },
- { "Etc/GMT+10" , 0x029A51 },
- { "Etc/GMT+11" , 0x029ADF },
- { "Etc/GMT+12" , 0x029B6D },
- { "Etc/GMT+2" , 0x029C88 },
- { "Etc/GMT+3" , 0x029D14 },
- { "Etc/GMT+4" , 0x029DA0 },
- { "Etc/GMT+5" , 0x029E2C },
- { "Etc/GMT+6" , 0x029EB8 },
- { "Etc/GMT+7" , 0x029F44 },
- { "Etc/GMT+8" , 0x029FD0 },
- { "Etc/GMT+9" , 0x02A05C },
- { "Etc/GMT-0" , 0x0298F6 },
- { "Etc/GMT-1" , 0x02997E },
- { "Etc/GMT-10" , 0x029A0A },
- { "Etc/GMT-11" , 0x029A98 },
- { "Etc/GMT-12" , 0x029B26 },
- { "Etc/GMT-13" , 0x029BB4 },
- { "Etc/GMT-14" , 0x029BFB },
- { "Etc/GMT-2" , 0x029C42 },
- { "Etc/GMT-3" , 0x029CCE },
- { "Etc/GMT-4" , 0x029D5A },
- { "Etc/GMT-5" , 0x029DE6 },
- { "Etc/GMT-6" , 0x029E72 },
- { "Etc/GMT-7" , 0x029EFE },
- { "Etc/GMT-8" , 0x029F8A },
- { "Etc/GMT-9" , 0x02A016 },
- { "Etc/GMT0" , 0x0298B2 },
- { "Etc/Greenwich" , 0x02A0A2 },
- { "Etc/UCT" , 0x02A0E6 },
- { "Etc/Universal" , 0x02A12A },
- { "Etc/UTC" , 0x02A16E },
- { "Etc/Zulu" , 0x02A1B2 },
- { "Europe/Amsterdam" , 0x02A1F6 },
- { "Europe/Andorra" , 0x02A634 },
- { "Europe/Athens" , 0x02A8B0 },
- { "Europe/Belfast" , 0x02ABF3 },
- { "Europe/Belgrade" , 0x02B12A },
- { "Europe/Berlin" , 0x02B3F3 },
- { "Europe/Bratislava" , 0x02B757 },
- { "Europe/Brussels" , 0x02BA89 },
- { "Europe/Bucharest" , 0x02BEC0 },
- { "Europe/Budapest" , 0x02C1EA },
- { "Europe/Busingen" , 0x02C55D },
- { "Europe/Chisinau" , 0x02C814 },
- { "Europe/Copenhagen" , 0x02CBA2 },
- { "Europe/Dublin" , 0x02CEAC },
- { "Europe/Gibraltar" , 0x02D3BD },
- { "Europe/Guernsey" , 0x02D814 },
- { "Europe/Helsinki" , 0x02DD4B },
- { "Europe/Isle_of_Man" , 0x02E001 },
- { "Europe/Istanbul" , 0x02E538 },
- { "Europe/Jersey" , 0x02E925 },
- { "Europe/Kaliningrad" , 0x02EE5C },
- { "Europe/Kiev" , 0x02F0C2 },
- { "Europe/Lisbon" , 0x02F3D9 },
- { "Europe/Ljubljana" , 0x02F8DD },
- { "Europe/London" , 0x02FBA6 },
- { "Europe/Luxembourg" , 0x0300DD },
- { "Europe/Madrid" , 0x030533 },
- { "Europe/Malta" , 0x0308F9 },
- { "Europe/Mariehamn" , 0x030CB2 },
- { "Europe/Minsk" , 0x030F68 },
- { "Europe/Monaco" , 0x031176 },
- { "Europe/Moscow" , 0x0315B1 },
- { "Europe/Nicosia" , 0x031802 },
- { "Europe/Oslo" , 0x031AEA },
- { "Europe/Paris" , 0x031E1C },
- { "Europe/Podgorica" , 0x032262 },
- { "Europe/Prague" , 0x03252B },
- { "Europe/Riga" , 0x03285D },
- { "Europe/Rome" , 0x032BA2 },
- { "Europe/Samara" , 0x032F65 },
- { "Europe/San_Marino" , 0x033198 },
- { "Europe/Sarajevo" , 0x03355B },
- { "Europe/Simferopol" , 0x033824 },
- { "Europe/Skopje" , 0x033B4F },
- { "Europe/Sofia" , 0x033E18 },
- { "Europe/Stockholm" , 0x034120 },
- { "Europe/Tallinn" , 0x0343CF },
- { "Europe/Tirane" , 0x034709 },
- { "Europe/Tiraspol" , 0x034A0F },
- { "Europe/Uzhgorod" , 0x034D9D },
- { "Europe/Vaduz" , 0x0350B4 },
- { "Europe/Vatican" , 0x035363 },
- { "Europe/Vienna" , 0x035726 },
- { "Europe/Vilnius" , 0x035A53 },
- { "Europe/Volgograd" , 0x035D92 },
- { "Europe/Warsaw" , 0x035F92 },
- { "Europe/Zagreb" , 0x036373 },
- { "Europe/Zaporozhye" , 0x03663C },
- { "Europe/Zurich" , 0x03697D },
- { "Factory" , 0x036C2C },
- { "GB" , 0x036C9D },
- { "GB-Eire" , 0x0371D4 },
- { "GMT" , 0x03770B },
- { "GMT+0" , 0x0377D7 },
- { "GMT-0" , 0x037793 },
- { "GMT0" , 0x03774F },
- { "Greenwich" , 0x03781B },
- { "Hongkong" , 0x03785F },
- { "HST" , 0x037A21 },
- { "Iceland" , 0x037A65 },
- { "Indian/Antananarivo" , 0x037C1E },
- { "Indian/Chagos" , 0x037C92 },
- { "Indian/Christmas" , 0x037CF4 },
- { "Indian/Cocos" , 0x037D38 },
- { "Indian/Comoro" , 0x037D7C },
- { "Indian/Kerguelen" , 0x037DD1 },
- { "Indian/Mahe" , 0x037E26 },
- { "Indian/Maldives" , 0x037E7B },
- { "Indian/Mauritius" , 0x037ED0 },
- { "Indian/Mayotte" , 0x037F46 },
- { "Indian/Reunion" , 0x037F9B },
- { "Iran" , 0x037FF0 },
- { "Israel" , 0x03825E },
- { "Jamaica" , 0x03858D },
- { "Japan" , 0x038652 },
- { "Kwajalein" , 0x0386DB },
- { "Libya" , 0x03873E },
- { "MET" , 0x038847 },
- { "Mexico/BajaNorte" , 0x038B50 },
- { "Mexico/BajaSur" , 0x038EB9 },
- { "Mexico/General" , 0x0390FE },
- { "MST" , 0x03935C },
- { "MST7MDT" , 0x0393A0 },
- { "Navajo" , 0x0396F1 },
- { "NZ" , 0x039A6A },
- { "NZ-CHAT" , 0x039DE8 },
- { "Pacific/Apia" , 0x03A0D0 },
- { "Pacific/Auckland" , 0x03A26C },
- { "Pacific/Chatham" , 0x03A5F8 },
- { "Pacific/Chuuk" , 0x03A8EF },
- { "Pacific/Easter" , 0x03A948 },
- { "Pacific/Efate" , 0x03ACA6 },
- { "Pacific/Enderbury" , 0x03AD6C },
- { "Pacific/Fakaofo" , 0x03ADDA },
- { "Pacific/Fiji" , 0x03AE2B },
- { "Pacific/Funafuti" , 0x03AFBE },
- { "Pacific/Galapagos" , 0x03B002 },
- { "Pacific/Gambier" , 0x03B07A },
- { "Pacific/Guadalcanal" , 0x03B0DF },
- { "Pacific/Guam" , 0x03B134 },
- { "Pacific/Honolulu" , 0x03B18A },
- { "Pacific/Johnston" , 0x03B201 },
- { "Pacific/Kiritimati" , 0x03B280 },
- { "Pacific/Kosrae" , 0x03B2EB },
- { "Pacific/Kwajalein" , 0x03B348 },
- { "Pacific/Majuro" , 0x03B3B4 },
- { "Pacific/Marquesas" , 0x03B413 },
- { "Pacific/Midway" , 0x03B47A },
- { "Pacific/Nauru" , 0x03B504 },
- { "Pacific/Niue" , 0x03B57C },
- { "Pacific/Norfolk" , 0x03B5DA },
- { "Pacific/Noumea" , 0x03B62F },
- { "Pacific/Pago_Pago" , 0x03B6BF },
- { "Pacific/Palau" , 0x03B748 },
- { "Pacific/Pitcairn" , 0x03B78C },
- { "Pacific/Pohnpei" , 0x03B7E1 },
- { "Pacific/Ponape" , 0x03B836 },
- { "Pacific/Port_Moresby" , 0x03B87B },
- { "Pacific/Rarotonga" , 0x03B8BF },
- { "Pacific/Saipan" , 0x03B99B },
- { "Pacific/Samoa" , 0x03B9FE },
- { "Pacific/Tahiti" , 0x03BA87 },
- { "Pacific/Tarawa" , 0x03BAEC },
- { "Pacific/Tongatapu" , 0x03BB40 },
- { "Pacific/Truk" , 0x03BBCC },
- { "Pacific/Wake" , 0x03BC11 },
- { "Pacific/Wallis" , 0x03BC61 },
- { "Pacific/Yap" , 0x03BCA5 },
- { "Poland" , 0x03BCEA },
- { "Portugal" , 0x03C0CB },
- { "PRC" , 0x03C5C7 },
- { "PST8PDT" , 0x03C678 },
- { "ROC" , 0x03C9C9 },
- { "ROK" , 0x03CAE1 },
- { "Singapore" , 0x03CB85 },
- { "Turkey" , 0x03CC3C },
- { "UCT" , 0x03D029 },
- { "Universal" , 0x03D06D },
- { "US/Alaska" , 0x03D0B1 },
- { "US/Aleutian" , 0x03D41A },
- { "US/Arizona" , 0x03D780 },
- { "US/Central" , 0x03D80E },
- { "US/East-Indiana" , 0x03E218 },
- { "US/Eastern" , 0x03DD19 },
- { "US/Hawaii" , 0x03E482 },
- { "US/Indiana-Starke" , 0x03E4F3 },
- { "US/Michigan" , 0x03E864 },
- { "US/Mountain" , 0x03EB9B },
- { "US/Pacific" , 0x03EF14 },
- { "US/Pacific-New" , 0x03F319 },
- { "US/Samoa" , 0x03F71E },
- { "UTC" , 0x03F7A7 },
- { "W-SU" , 0x03FA9E },
- { "WET" , 0x03F7EB },
- { "Zulu" , 0x03FCD8 },
+ { "Asia/Anadyr" , 0x01911B },
+ { "Asia/Aqtau" , 0x019300 },
+ { "Asia/Aqtobe" , 0x0194FF },
+ { "Asia/Ashgabat" , 0x0196B7 },
+ { "Asia/Ashkhabad" , 0x0197D4 },
+ { "Asia/Baghdad" , 0x0198F1 },
+ { "Asia/Bahrain" , 0x019A66 },
+ { "Asia/Baku" , 0x019ACC },
+ { "Asia/Bangkok" , 0x019DB4 },
+ { "Asia/Beirut" , 0x019E09 },
+ { "Asia/Bishkek" , 0x01A116 },
+ { "Asia/Brunei" , 0x01A2C2 },
+ { "Asia/Calcutta" , 0x01A324 },
+ { "Asia/Choibalsan" , 0x01A39D },
+ { "Asia/Chongqing" , 0x01A516 },
+ { "Asia/Chungking" , 0x01A605 },
+ { "Asia/Colombo" , 0x01A6B4 },
+ { "Asia/Dacca" , 0x01A750 },
+ { "Asia/Damascus" , 0x01A7F6 },
+ { "Asia/Dhaka" , 0x01AB46 },
+ { "Asia/Dili" , 0x01ABEC },
+ { "Asia/Dubai" , 0x01AC76 },
+ { "Asia/Dushanbe" , 0x01ACCB },
+ { "Asia/Gaza" , 0x01ADCE },
+ { "Asia/Harbin" , 0x01B121 },
+ { "Asia/Hebron" , 0x01B208 },
+ { "Asia/Ho_Chi_Minh" , 0x01B564 },
+ { "Asia/Hong_Kong" , 0x01B5DC },
+ { "Asia/Hovd" , 0x01B79E },
+ { "Asia/Irkutsk" , 0x01B916 },
+ { "Asia/Istanbul" , 0x01BAFC },
+ { "Asia/Jakarta" , 0x01BEE9 },
+ { "Asia/Jayapura" , 0x01BF93 },
+ { "Asia/Jerusalem" , 0x01C02F },
+ { "Asia/Kabul" , 0x01C35E },
+ { "Asia/Kamchatka" , 0x01C3AF },
+ { "Asia/Karachi" , 0x01C58B },
+ { "Asia/Kashgar" , 0x01C640 },
+ { "Asia/Kathmandu" , 0x01C711 },
+ { "Asia/Katmandu" , 0x01C777 },
+ { "Asia/Khandyga" , 0x01C7DD },
+ { "Asia/Kolkata" , 0x01CA02 },
+ { "Asia/Krasnoyarsk" , 0x01CA7B },
+ { "Asia/Kuala_Lumpur" , 0x01CC63 },
+ { "Asia/Kuching" , 0x01CD20 },
+ { "Asia/Kuwait" , 0x01CE0E },
+ { "Asia/Macao" , 0x01CE63 },
+ { "Asia/Macau" , 0x01CF9E },
+ { "Asia/Magadan" , 0x01D0D9 },
+ { "Asia/Makassar" , 0x01D2BB },
+ { "Asia/Manila" , 0x01D380 },
+ { "Asia/Muscat" , 0x01D405 },
+ { "Asia/Nicosia" , 0x01D45A },
+ { "Asia/Novokuznetsk" , 0x01D742 },
+ { "Asia/Novosibirsk" , 0x01D944 },
+ { "Asia/Omsk" , 0x01DB2F },
+ { "Asia/Oral" , 0x01DD16 },
+ { "Asia/Phnom_Penh" , 0x01DEE6 },
+ { "Asia/Pontianak" , 0x01DF5E },
+ { "Asia/Pyongyang" , 0x01E020 },
+ { "Asia/Qatar" , 0x01E08D },
+ { "Asia/Qyzylorda" , 0x01E0F3 },
+ { "Asia/Rangoon" , 0x01E2C9 },
+ { "Asia/Riyadh" , 0x01E341 },
+ { "Asia/Saigon" , 0x01E396 },
+ { "Asia/Sakhalin" , 0x01E40E },
+ { "Asia/Samarkand" , 0x01E605 },
+ { "Asia/Seoul" , 0x01E73B },
+ { "Asia/Shanghai" , 0x01E7DF },
+ { "Asia/Singapore" , 0x01E8BF },
+ { "Asia/Taipei" , 0x01E976 },
+ { "Asia/Tashkent" , 0x01EA8E },
+ { "Asia/Tbilisi" , 0x01EBBF },
+ { "Asia/Tehran" , 0x01ED79 },
+ { "Asia/Tel_Aviv" , 0x01EFE7 },
+ { "Asia/Thimbu" , 0x01F316 },
+ { "Asia/Thimphu" , 0x01F37C },
+ { "Asia/Tokyo" , 0x01F3E2 },
+ { "Asia/Ujung_Pandang" , 0x01F46B },
+ { "Asia/Ulaanbaatar" , 0x01F4E8 },
+ { "Asia/Ulan_Bator" , 0x01F643 },
+ { "Asia/Urumqi" , 0x01F790 },
+ { "Asia/Ust-Nera" , 0x01F857 },
+ { "Asia/Vientiane" , 0x01FA5C },
+ { "Asia/Vladivostok" , 0x01FAD4 },
+ { "Asia/Yakutsk" , 0x01FCC0 },
+ { "Asia/Yekaterinburg" , 0x01FEA5 },
+ { "Asia/Yerevan" , 0x0200B0 },
+ { "Atlantic/Azores" , 0x0202B0 },
+ { "Atlantic/Bermuda" , 0x0207B3 },
+ { "Atlantic/Canary" , 0x020A94 },
+ { "Atlantic/Cape_Verde" , 0x020D6A },
+ { "Atlantic/Faeroe" , 0x020DE3 },
+ { "Atlantic/Faroe" , 0x021087 },
+ { "Atlantic/Jan_Mayen" , 0x02132B },
+ { "Atlantic/Madeira" , 0x02165D },
+ { "Atlantic/Reykjavik" , 0x021B66 },
+ { "Atlantic/South_Georgia" , 0x021D1F },
+ { "Atlantic/St_Helena" , 0x021F31 },
+ { "Atlantic/Stanley" , 0x021D63 },
+ { "Australia/ACT" , 0x021F86 },
+ { "Australia/Adelaide" , 0x0222A3 },
+ { "Australia/Brisbane" , 0x0225CF },
+ { "Australia/Broken_Hill" , 0x022696 },
+ { "Australia/Canberra" , 0x0229D4 },
+ { "Australia/Currie" , 0x022CF1 },
+ { "Australia/Darwin" , 0x023024 },
+ { "Australia/Eucla" , 0x0230AA },
+ { "Australia/Hobart" , 0x02317F },
+ { "Australia/LHI" , 0x0234DD },
+ { "Australia/Lindeman" , 0x023778 },
+ { "Australia/Lord_Howe" , 0x023859 },
+ { "Australia/Melbourne" , 0x023B04 },
+ { "Australia/North" , 0x023E29 },
+ { "Australia/NSW" , 0x023E9D },
+ { "Australia/Perth" , 0x0241BA },
+ { "Australia/Queensland" , 0x024292 },
+ { "Australia/South" , 0x02433E },
+ { "Australia/Sydney" , 0x02465B },
+ { "Australia/Tasmania" , 0x024998 },
+ { "Australia/Victoria" , 0x024CDD },
+ { "Australia/West" , 0x024FFA },
+ { "Australia/Yancowinna" , 0x0250B0 },
+ { "Brazil/Acre" , 0x0253D2 },
+ { "Brazil/DeNoronha" , 0x0254D6 },
+ { "Brazil/East" , 0x0255F6 },
+ { "Brazil/West" , 0x0258D3 },
+ { "Canada/Atlantic" , 0x0259CB },
+ { "Canada/Central" , 0x025EB3 },
+ { "Canada/East-Saskatchewan" , 0x0267BD },
+ { "Canada/Eastern" , 0x0262CD },
+ { "Canada/Mountain" , 0x026946 },
+ { "Canada/Newfoundland" , 0x026CBC },
+ { "Canada/Pacific" , 0x0271E7 },
+ { "Canada/Saskatchewan" , 0x027600 },
+ { "Canada/Yukon" , 0x027789 },
+ { "CET" , 0x027A8C },
+ { "Chile/Continental" , 0x027D95 },
+ { "Chile/EasterIsland" , 0x028130 },
+ { "CST6CDT" , 0x028472 },
+ { "Cuba" , 0x0287C3 },
+ { "EET" , 0x028B36 },
+ { "Egypt" , 0x028DE9 },
+ { "Eire" , 0x0290AC },
+ { "EST" , 0x0295BD },
+ { "EST5EDT" , 0x029601 },
+ { "Etc/GMT" , 0x029952 },
+ { "Etc/GMT+0" , 0x029A1E },
+ { "Etc/GMT+1" , 0x029AA8 },
+ { "Etc/GMT+10" , 0x029B35 },
+ { "Etc/GMT+11" , 0x029BC3 },
+ { "Etc/GMT+12" , 0x029C51 },
+ { "Etc/GMT+2" , 0x029D6C },
+ { "Etc/GMT+3" , 0x029DF8 },
+ { "Etc/GMT+4" , 0x029E84 },
+ { "Etc/GMT+5" , 0x029F10 },
+ { "Etc/GMT+6" , 0x029F9C },
+ { "Etc/GMT+7" , 0x02A028 },
+ { "Etc/GMT+8" , 0x02A0B4 },
+ { "Etc/GMT+9" , 0x02A140 },
+ { "Etc/GMT-0" , 0x0299DA },
+ { "Etc/GMT-1" , 0x029A62 },
+ { "Etc/GMT-10" , 0x029AEE },
+ { "Etc/GMT-11" , 0x029B7C },
+ { "Etc/GMT-12" , 0x029C0A },
+ { "Etc/GMT-13" , 0x029C98 },
+ { "Etc/GMT-14" , 0x029CDF },
+ { "Etc/GMT-2" , 0x029D26 },
+ { "Etc/GMT-3" , 0x029DB2 },
+ { "Etc/GMT-4" , 0x029E3E },
+ { "Etc/GMT-5" , 0x029ECA },
+ { "Etc/GMT-6" , 0x029F56 },
+ { "Etc/GMT-7" , 0x029FE2 },
+ { "Etc/GMT-8" , 0x02A06E },
+ { "Etc/GMT-9" , 0x02A0FA },
+ { "Etc/GMT0" , 0x029996 },
+ { "Etc/Greenwich" , 0x02A186 },
+ { "Etc/UCT" , 0x02A1CA },
+ { "Etc/Universal" , 0x02A20E },
+ { "Etc/UTC" , 0x02A252 },
+ { "Etc/Zulu" , 0x02A296 },
+ { "Europe/Amsterdam" , 0x02A2DA },
+ { "Europe/Andorra" , 0x02A718 },
+ { "Europe/Athens" , 0x02A994 },
+ { "Europe/Belfast" , 0x02ACD7 },
+ { "Europe/Belgrade" , 0x02B20E },
+ { "Europe/Berlin" , 0x02B4D7 },
+ { "Europe/Bratislava" , 0x02B83B },
+ { "Europe/Brussels" , 0x02BB6D },
+ { "Europe/Bucharest" , 0x02BFA4 },
+ { "Europe/Budapest" , 0x02C2CE },
+ { "Europe/Busingen" , 0x02C641 },
+ { "Europe/Chisinau" , 0x02C8F8 },
+ { "Europe/Copenhagen" , 0x02CC86 },
+ { "Europe/Dublin" , 0x02CF90 },
+ { "Europe/Gibraltar" , 0x02D4A1 },
+ { "Europe/Guernsey" , 0x02D8F8 },
+ { "Europe/Helsinki" , 0x02DE2F },
+ { "Europe/Isle_of_Man" , 0x02E0E5 },
+ { "Europe/Istanbul" , 0x02E61C },
+ { "Europe/Jersey" , 0x02EA09 },
+ { "Europe/Kaliningrad" , 0x02EF40 },
+ { "Europe/Kiev" , 0x02F1A6 },
+ { "Europe/Lisbon" , 0x02F4BD },
+ { "Europe/Ljubljana" , 0x02F9C1 },
+ { "Europe/London" , 0x02FC8A },
+ { "Europe/Luxembourg" , 0x0301C1 },
+ { "Europe/Madrid" , 0x030617 },
+ { "Europe/Malta" , 0x0309DD },
+ { "Europe/Mariehamn" , 0x030D96 },
+ { "Europe/Minsk" , 0x03104C },
+ { "Europe/Monaco" , 0x03125A },
+ { "Europe/Moscow" , 0x031695 },
+ { "Europe/Nicosia" , 0x0318E6 },
+ { "Europe/Oslo" , 0x031BCE },
+ { "Europe/Paris" , 0x031F00 },
+ { "Europe/Podgorica" , 0x032346 },
+ { "Europe/Prague" , 0x03260F },
+ { "Europe/Riga" , 0x032941 },
+ { "Europe/Rome" , 0x032C86 },
+ { "Europe/Samara" , 0x033049 },
+ { "Europe/San_Marino" , 0x03327C },
+ { "Europe/Sarajevo" , 0x03363F },
+ { "Europe/Simferopol" , 0x033908 },
+ { "Europe/Skopje" , 0x033C33 },
+ { "Europe/Sofia" , 0x033EFC },
+ { "Europe/Stockholm" , 0x034204 },
+ { "Europe/Tallinn" , 0x0344B3 },
+ { "Europe/Tirane" , 0x0347ED },
+ { "Europe/Tiraspol" , 0x034AF3 },
+ { "Europe/Uzhgorod" , 0x034E81 },
+ { "Europe/Vaduz" , 0x035198 },
+ { "Europe/Vatican" , 0x035447 },
+ { "Europe/Vienna" , 0x03580A },
+ { "Europe/Vilnius" , 0x035B37 },
+ { "Europe/Volgograd" , 0x035E76 },
+ { "Europe/Warsaw" , 0x036076 },
+ { "Europe/Zagreb" , 0x036457 },
+ { "Europe/Zaporozhye" , 0x036720 },
+ { "Europe/Zurich" , 0x036A61 },
+ { "Factory" , 0x036D10 },
+ { "GB" , 0x036D81 },
+ { "GB-Eire" , 0x0372B8 },
+ { "GMT" , 0x0377EF },
+ { "GMT+0" , 0x0378BB },
+ { "GMT-0" , 0x037877 },
+ { "GMT0" , 0x037833 },
+ { "Greenwich" , 0x0378FF },
+ { "Hongkong" , 0x037943 },
+ { "HST" , 0x037B05 },
+ { "Iceland" , 0x037B49 },
+ { "Indian/Antananarivo" , 0x037D02 },
+ { "Indian/Chagos" , 0x037D76 },
+ { "Indian/Christmas" , 0x037DD8 },
+ { "Indian/Cocos" , 0x037E1C },
+ { "Indian/Comoro" , 0x037E60 },
+ { "Indian/Kerguelen" , 0x037EB5 },
+ { "Indian/Mahe" , 0x037F0A },
+ { "Indian/Maldives" , 0x037F5F },
+ { "Indian/Mauritius" , 0x037FB4 },
+ { "Indian/Mayotte" , 0x03802A },
+ { "Indian/Reunion" , 0x03807F },
+ { "Iran" , 0x0380D4 },
+ { "Israel" , 0x038342 },
+ { "Jamaica" , 0x038671 },
+ { "Japan" , 0x038736 },
+ { "Kwajalein" , 0x0387BF },
+ { "Libya" , 0x038822 },
+ { "MET" , 0x03892B },
+ { "Mexico/BajaNorte" , 0x038C34 },
+ { "Mexico/BajaSur" , 0x038F9D },
+ { "Mexico/General" , 0x0391E2 },
+ { "MST" , 0x039440 },
+ { "MST7MDT" , 0x039484 },
+ { "Navajo" , 0x0397D5 },
+ { "NZ" , 0x039B4E },
+ { "NZ-CHAT" , 0x039ECC },
+ { "Pacific/Apia" , 0x03A1B4 },
+ { "Pacific/Auckland" , 0x03A350 },
+ { "Pacific/Chatham" , 0x03A6DC },
+ { "Pacific/Chuuk" , 0x03A9D3 },
+ { "Pacific/Easter" , 0x03AA2C },
+ { "Pacific/Efate" , 0x03AD8A },
+ { "Pacific/Enderbury" , 0x03AE50 },
+ { "Pacific/Fakaofo" , 0x03AEBE },
+ { "Pacific/Fiji" , 0x03AF0F },
+ { "Pacific/Funafuti" , 0x03B0A2 },
+ { "Pacific/Galapagos" , 0x03B0E6 },
+ { "Pacific/Gambier" , 0x03B15E },
+ { "Pacific/Guadalcanal" , 0x03B1C3 },
+ { "Pacific/Guam" , 0x03B218 },
+ { "Pacific/Honolulu" , 0x03B26E },
+ { "Pacific/Johnston" , 0x03B2E5 },
+ { "Pacific/Kiritimati" , 0x03B364 },
+ { "Pacific/Kosrae" , 0x03B3CF },
+ { "Pacific/Kwajalein" , 0x03B42C },
+ { "Pacific/Majuro" , 0x03B498 },
+ { "Pacific/Marquesas" , 0x03B4F7 },
+ { "Pacific/Midway" , 0x03B55E },
+ { "Pacific/Nauru" , 0x03B5E8 },
+ { "Pacific/Niue" , 0x03B660 },
+ { "Pacific/Norfolk" , 0x03B6BE },
+ { "Pacific/Noumea" , 0x03B713 },
+ { "Pacific/Pago_Pago" , 0x03B7A3 },
+ { "Pacific/Palau" , 0x03B82C },
+ { "Pacific/Pitcairn" , 0x03B870 },
+ { "Pacific/Pohnpei" , 0x03B8C5 },
+ { "Pacific/Ponape" , 0x03B91A },
+ { "Pacific/Port_Moresby" , 0x03B95F },
+ { "Pacific/Rarotonga" , 0x03B9A3 },
+ { "Pacific/Saipan" , 0x03BA7F },
+ { "Pacific/Samoa" , 0x03BAE2 },
+ { "Pacific/Tahiti" , 0x03BB6B },
+ { "Pacific/Tarawa" , 0x03BBD0 },
+ { "Pacific/Tongatapu" , 0x03BC24 },
+ { "Pacific/Truk" , 0x03BCB0 },
+ { "Pacific/Wake" , 0x03BCF5 },
+ { "Pacific/Wallis" , 0x03BD45 },
+ { "Pacific/Yap" , 0x03BD89 },
+ { "Poland" , 0x03BDCE },
+ { "Portugal" , 0x03C1AF },
+ { "PRC" , 0x03C6AB },
+ { "PST8PDT" , 0x03C75C },
+ { "ROC" , 0x03CAAD },
+ { "ROK" , 0x03CBC5 },
+ { "Singapore" , 0x03CC69 },
+ { "Turkey" , 0x03CD20 },
+ { "UCT" , 0x03D10D },
+ { "Universal" , 0x03D151 },
+ { "US/Alaska" , 0x03D195 },
+ { "US/Aleutian" , 0x03D4FE },
+ { "US/Arizona" , 0x03D864 },
+ { "US/Central" , 0x03D8F2 },
+ { "US/East-Indiana" , 0x03E2FC },
+ { "US/Eastern" , 0x03DDFD },
+ { "US/Hawaii" , 0x03E566 },
+ { "US/Indiana-Starke" , 0x03E5D7 },
+ { "US/Michigan" , 0x03E948 },
+ { "US/Mountain" , 0x03EC7F },
+ { "US/Pacific" , 0x03EFF8 },
+ { "US/Pacific-New" , 0x03F3FD },
+ { "US/Samoa" , 0x03F802 },
+ { "UTC" , 0x03F88B },
+ { "W-SU" , 0x03FB82 },
+ { "WET" , 0x03F8CF },
+ { "Zulu" , 0x03FDBC },
};
/* This is a generated file, do not modify */
-const unsigned char timelib_timezone_db_data_builtin[261404] = {
+const unsigned char timelib_timezone_db_data_builtin[261632] = {
/* Africa/Abidjan */
@@ -3490,7 +3490,7 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50,
0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0,
0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0,
-0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x66, 0x5B, 0xD0, 0x45, 0x44, 0x35, 0x50,
0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50,
0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0x9C, 0x6D, 0x50, 0x4C, 0xCC, 0xF7, 0xD0,
0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x95, 0xF6, 0x50,
@@ -7552,8 +7552,8 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
/* Asia/Amman */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xD6, 0xD0,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0,
0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0,
0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0,
0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0,
@@ -7570,17 +7570,31 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2C, 0x54, 0xE0, 0x45, 0x41, 0x2F, 0xE0,
0x46, 0x0C, 0x36, 0xE0, 0x47, 0x21, 0x11, 0xE0, 0x47, 0xEC, 0x18, 0xE0, 0x49, 0x0A, 0x2E, 0x60,
0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xEA, 0x10, 0x60, 0x4B, 0xAB, 0xDC, 0xE0, 0x4C, 0xC9, 0xF2, 0x60,
-0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x89, 0xB6, 0x60,
+0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x52, 0xB3, 0x5E, 0x50,
+0x53, 0x34, 0x9F, 0x60, 0x54, 0x52, 0xB4, 0xE0, 0x55, 0x14, 0x81, 0x60, 0x56, 0x32, 0x96, 0xE0,
+0x56, 0xFD, 0x9D, 0xE0, 0x58, 0x12, 0x78, 0xE0, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xF2, 0x5A, 0xE0,
+0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xD2, 0x3C, 0xE0, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0xB2, 0x1E, 0xE0,
+0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x9B, 0x3B, 0x60, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x7B, 0x1D, 0x60,
+0x62, 0x46, 0x24, 0x60, 0x63, 0x5A, 0xFF, 0x60, 0x64, 0x26, 0x06, 0x60, 0x65, 0x3A, 0xE1, 0x60,
+0x66, 0x05, 0xE8, 0x60, 0x67, 0x1A, 0xC3, 0x60, 0x67, 0xE5, 0xCA, 0x60, 0x69, 0x03, 0xDF, 0xE0,
+0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xE3, 0xC1, 0xE0, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0xC3, 0xA3, 0xE0,
+0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0xA3, 0x85, 0xE0, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x83, 0x67, 0xE0,
+0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x63, 0x49, 0xE0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x4C, 0x66, 0x60,
+0x75, 0x0E, 0x32, 0xE0, 0x76, 0x2C, 0x48, 0x60, 0x76, 0xF7, 0x4F, 0x60, 0x78, 0x0C, 0x2A, 0x60,
+0x78, 0xD7, 0x31, 0x60, 0x79, 0xEC, 0x0C, 0x60, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0xCB, 0xEE, 0x60,
+0x7C, 0x96, 0xF5, 0x60, 0x7D, 0xB5, 0x0A, 0xE0, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x94, 0xEC, 0xE0,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01,
0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
-0x03, 0x01, 0x03, 0x01, 0x05, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A,
-0x30, 0x01, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53,
-0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, 0x7C, 0xF5, 0x00, 0x00,
-0x00, 0x00,
+0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49,
+0x7C, 0xF5, 0x00, 0x00, 0x00, 0x00,
/* Asia/Anadyr */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -11908,7 +11922,7 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50,
0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0,
0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0,
-0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x66, 0x5B, 0xD0, 0x45, 0x44, 0x35, 0x50,
0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50,
0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0x9C, 0x6D, 0x50, 0x4C, 0xCC, 0xF7, 0xD0,
0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x95, 0xF6, 0x50,
@@ -18402,4 +18416,4 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = {
0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80,
0x00, 0x00, 0x00, 0x00, };
-const timelib_tzdb timezonedb_builtin = { "2013.8", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2013.9", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c
index c177feebb..194b3b211 100644
--- a/ext/date/lib/unixtime2tm.c
+++ b/ext/date/lib/unixtime2tm.c
@@ -137,19 +137,16 @@ void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts)
void timelib_update_from_sse(timelib_time *tm)
{
timelib_sll sse;
+ int z = tm->z;
+ signed int dst = tm->dst;
sse = tm->sse;
switch (tm->zone_type) {
case TIMELIB_ZONETYPE_ABBR:
case TIMELIB_ZONETYPE_OFFSET: {
- int z = tm->z;
- signed int dst = tm->dst;
-
timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60) + (tm->dst * 3600));
- tm->z = z;
- tm->dst = dst;
goto cleanup;
}
@@ -171,6 +168,8 @@ cleanup:
tm->sse = sse;
tm->is_localtime = 1;
tm->have_zone = 1;
+ tm->z = z;
+ tm->dst = dst;
}
void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 13a645117..d96428d5e 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -797,6 +797,14 @@ PHP_RSHUTDOWN_FUNCTION(date)
#define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO"
+/*
+ * This comes from various sources that like to contradict. I'm going with the
+ * format here because of:
+ * http://msdn.microsoft.com/en-us/library/windows/desktop/aa384321%28v=vs.85%29.aspx
+ * and http://curl.haxx.se/rfc/cookie_spec.html
+ */
+#define DATE_FORMAT_COOKIE "l, d-M-Y H:i:s T"
+
#define DATE_TZ_ERRMSG \
"It is not safe to rely on the system's timezone settings. You are " \
"*required* to use the date.timezone setting or the " \
@@ -827,7 +835,7 @@ PHP_MINIT_FUNCTION(date)
* with the variations that the only legal time zone is GMT
* and the separators between the elements of the date must be dashes."
*/
- REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_COOKIE, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC822, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
@@ -1981,12 +1989,25 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval
return (zend_object_iterator*)iterator;
}
+static int implement_date_interface_handler(zend_class_entry *interface, zend_class_entry *implementor TSRMLS_DC)
+{
+ if (implementor->type == ZEND_USER_CLASS &&
+ !instanceof_function(implementor, date_ce_date TSRMLS_CC) &&
+ !instanceof_function(implementor, date_ce_immutable TSRMLS_CC)
+ ) {
+ zend_error(E_ERROR, "DateTimeInterface can't be implemented by user classes");
+ }
+
+ return SUCCESS;
+}
+
static void date_register_classes(TSRMLS_D)
{
zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_interface;
INIT_CLASS_ENTRY(ce_interface, "DateTimeInterface", date_funcs_interface);
date_ce_interface = zend_register_internal_interface(&ce_interface TSRMLS_CC);
+ date_ce_interface->interface_gets_implemented = implement_date_interface_handler;
INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date);
ce_date.create_object = date_object_new_date;
@@ -2002,7 +2023,7 @@ static void date_register_classes(TSRMLS_D)
zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339);
- REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC850);
+ REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_COOKIE);
REGISTER_DATE_CLASS_CONST_STRING("ISO8601", DATE_FORMAT_ISO8601);
REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC822);
REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850);
@@ -2602,6 +2623,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
timelib_fill_holes(dateobj->time, now, TIMELIB_NO_CLONE);
timelib_update_ts(dateobj->time, tzi);
+ timelib_update_from_sse(dateobj->time);
dateobj->time->have_relative = 0;
@@ -3115,33 +3137,16 @@ static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS
{
php_date_obj *dateobj;
php_interval_obj *intobj;
- int bias = 1;
+ timelib_time *new_time;
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC);
DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval);
- if (intobj->diff->have_weekday_relative || intobj->diff->have_special_relative) {
- memcpy(&dateobj->time->relative, intobj->diff, sizeof(struct timelib_rel_time));
- } else {
- if (intobj->diff->invert) {
- bias = -1;
- }
- memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
- dateobj->time->relative.y = intobj->diff->y * bias;
- dateobj->time->relative.m = intobj->diff->m * bias;
- dateobj->time->relative.d = intobj->diff->d * bias;
- dateobj->time->relative.h = intobj->diff->h * bias;
- dateobj->time->relative.i = intobj->diff->i * bias;
- dateobj->time->relative.s = intobj->diff->s * bias;
- }
- dateobj->time->have_relative = 1;
- dateobj->time->sse_uptodate = 0;
-
- timelib_update_ts(dateobj->time, NULL);
- timelib_update_from_sse(dateobj->time);
- dateobj->time->have_relative = 0;
+ new_time = timelib_add(dateobj->time, intobj->diff);
+ timelib_time_dtor(dateobj->time);
+ dateobj->time = new_time;
}
/* {{{ proto DateTime date_add(DateTime object, DateInterval interval)
@@ -3182,7 +3187,7 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
{
php_date_obj *dateobj;
php_interval_obj *intobj;
- int bias = 1;
+ timelib_time *new_time;
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
@@ -3194,24 +3199,9 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
return;
}
- if (intobj->diff->invert) {
- bias = -1;
- }
-
- memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
- dateobj->time->relative.y = 0 - (intobj->diff->y * bias);
- dateobj->time->relative.m = 0 - (intobj->diff->m * bias);
- dateobj->time->relative.d = 0 - (intobj->diff->d * bias);
- dateobj->time->relative.h = 0 - (intobj->diff->h * bias);
- dateobj->time->relative.i = 0 - (intobj->diff->i * bias);
- dateobj->time->relative.s = 0 - (intobj->diff->s * bias);
- dateobj->time->have_relative = 1;
- dateobj->time->sse_uptodate = 0;
-
- timelib_update_ts(dateobj->time, NULL);
- timelib_update_from_sse(dateobj->time);
-
- dateobj->time->have_relative = 0;
+ new_time = timelib_sub(dateobj->time, intobj->diff);
+ timelib_time_dtor(dateobj->time);
+ dateobj->time = new_time;
}
/* {{{ proto DateTime date_sub(DateTime object, DateInterval interval)
@@ -3603,13 +3593,13 @@ PHP_FUNCTION(date_diff)
php_interval_obj *interval;
long absolute = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &object1, date_ce_date, &object2, date_ce_date, &absolute) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_FALSE;
}
dateobj1 = (php_date_obj *) zend_object_store_get_object(object1 TSRMLS_CC);
dateobj2 = (php_date_obj *) zend_object_store_get_object(object2 TSRMLS_CC);
- DATE_CHECK_INITIALIZED(dateobj1->time, DateTime);
- DATE_CHECK_INITIALIZED(dateobj2->time, DateTime);
+ DATE_CHECK_INITIALIZED(dateobj1->time, DateTimeInterface);
+ DATE_CHECK_INITIALIZED(dateobj2->time, DateTimeInterface);
timelib_update_ts(dateobj1->time, NULL);
timelib_update_ts(dateobj2->time, NULL);
@@ -4387,7 +4377,7 @@ PHP_METHOD(DatePeriod, __construct)
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOl|l", &start, date_ce_interface, &interval, date_ce_interval, &recurrences, &options) == FAILURE) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_date, &options) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_interface, &options) == FAILURE) {
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &isostr, &isostr_len, &options) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.");
zend_restore_error_handling(&error_handling TSRMLS_CC);
diff --git a/ext/date/tests/DateTime_format_basic2.phpt b/ext/date/tests/DateTime_format_basic2.phpt
index d7adaa5df..016fa7b6b 100644
--- a/ext/date/tests/DateTime_format_basic2.phpt
+++ b/ext/date/tests/DateTime_format_basic2.phpt
@@ -31,7 +31,7 @@ var_dump( $date->format( DateTime::W3C) ) ;
--EXPECT--
*** Testing date_format() : basic functionality - formatting coinstants ***
string(25) "2005-07-14T22:30:41+01:00"
-string(32) "Thursday, 14-Jul-05 22:30:41 BST"
+string(34) "Thursday, 14-Jul-2005 22:30:41 BST"
string(24) "2005-07-14T22:30:41+0100"
string(29) "Thu, 14 Jul 05 22:30:41 +0100"
string(32) "Thursday, 14-Jul-05 22:30:41 BST"
diff --git a/ext/date/tests/DateTime_verify.phpt b/ext/date/tests/DateTime_verify.phpt
index a03911f5c..c79097472 100644
--- a/ext/date/tests/DateTime_verify.phpt
+++ b/ext/date/tests/DateTime_verify.phpt
@@ -160,7 +160,7 @@ array(11) {
["ATOM"]=>
string(13) "Y-m-d\TH:i:sP"
["COOKIE"]=>
- string(16) "l, d-M-y H:i:s T"
+ string(16) "l, d-M-Y H:i:s T"
["ISO8601"]=>
string(13) "Y-m-d\TH:i:sO"
["RFC822"]=>
@@ -180,4 +180,4 @@ array(11) {
["W3C"]=>
string(13) "Y-m-d\TH:i:sP"
}
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/ext/date/tests/bug52063.phpt b/ext/date/tests/bug52063.phpt
index af9da9e42..7364a8061 100644
--- a/ext/date/tests/bug52063.phpt
+++ b/ext/date/tests/bug52063.phpt
@@ -11,5 +11,5 @@ echo $a->format(DateTime::COOKIE);
echo "\n";
?>
--EXPECTF--
-Thursday, 01-Jan-09 00:00:00 WET
-Thursday, 01-Jan-09 00:00:00 WET
+Thursday, 01-Jan-2009 00:00:00 WET
+Thursday, 01-Jan-2009 00:00:00 WET
diff --git a/ext/date/tests/bug53879.phpt b/ext/date/tests/bug53879.phpt
new file mode 100644
index 000000000..3d16c9720
--- /dev/null
+++ b/ext/date/tests/bug53879.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #53879 (DateTime::createFromFormat() fails to parse cookie expiration date)
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+$date = DateTime::createFromFormat(DateTime::COOKIE, "Mon, 21-Jan-2041 15:24:52 GMT");
+print_r($date);
+?>
+--EXPECTF--
+DateTime Object
+(
+ [date] => 2041-01-21 15:24:52
+ [timezone_type] => 2
+ [timezone] => GMT
+)
diff --git a/ext/date/tests/bug63391.phpt b/ext/date/tests/bug63391.phpt
new file mode 100644
index 000000000..a29d25e73
--- /dev/null
+++ b/ext/date/tests/bug63391.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Test for #63391 (Incorrect/inconsistent day of week prior to the year 1600)
+--FILE--
+<?php
+ini_set('date.timezone', 'UTC');
+
+print "Date PHP\n";
+print "---------- ---\n";
+$dates = array('1599-12-30', '1599-12-31', '1600-01-01', '1600-01-02');
+foreach ($dates as $date) {
+ echo date_create($date)->format('Y-m-d D'), "\n";
+}
+?>
+--EXPECT--
+Date PHP
+---------- ---
+1599-12-30 Thu
+1599-12-31 Fri
+1600-01-01 Sat
+1600-01-02 Sun
diff --git a/ext/date/tests/date_constants.phpt b/ext/date/tests/date_constants.phpt
index 132e24159..b9fce8c78 100644
--- a/ext/date/tests/date_constants.phpt
+++ b/ext/date/tests/date_constants.phpt
@@ -41,8 +41,8 @@ Date constants
--EXPECT--
string(25) "2006-07-01T14:27:30+02:00"
string(25) "2006-05-30T14:32:13+02:00"
-string(33) "Saturday, 01-Jul-06 14:27:30 CEST"
-string(32) "Tuesday, 30-May-06 14:32:13 CEST"
+string(35) "Saturday, 01-Jul-2006 14:27:30 CEST"
+string(34) "Tuesday, 30-May-2006 14:32:13 CEST"
string(24) "2006-07-01T14:27:30+0200"
string(24) "2006-05-30T14:32:13+0200"
string(29) "Sat, 01 Jul 06 14:27:30 +0200"
diff --git a/ext/date/tests/forward-transition-construction.phpt b/ext/date/tests/forward-transition-construction.phpt
new file mode 100644
index 000000000..8f195a51b
--- /dev/null
+++ b/ext/date/tests/forward-transition-construction.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test for Date/Time construction during a forward DST transition
+--FILE--
+<?php
+date_default_timezone_set('America/New_York');
+
+$date = new DateTime('2010-03-14 01:30:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+
+$date = new DateTime('2010-03-14 02:00:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+
+$date = new DateTime('2010-03-14 02:30:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+
+$date = new DateTime('2010-03-14 03:00:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+
+$date = new DateTime('2010-03-14 03:30:00');
+echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
+?>
+--EXPECT--
+2010-03-14 01:30:00 EST/America/New_York - 1268548200
+2010-03-14 03:00:00 EDT/America/New_York - 1268550000
+2010-03-14 03:30:00 EDT/America/New_York - 1268551800
+2010-03-14 03:00:00 EDT/America/New_York - 1268550000
+2010-03-14 03:30:00 EDT/America/New_York - 1268551800
diff --git a/ext/date/tests/gmdate_variation13.phpt b/ext/date/tests/gmdate_variation13.phpt
index 5a19ae268..1d1f434ec 100644
--- a/ext/date/tests/gmdate_variation13.phpt
+++ b/ext/date/tests/gmdate_variation13.phpt
@@ -45,7 +45,7 @@ string(25) "2008-08-08T08:08:08+00:00"
string(%d) "%s"
--DATE_COOKIE Constant--
-string(30) "Friday, 08-Aug-08 08:08:08 GMT"
+string(32) "Friday, 08-Aug-2008 08:08:08 GMT"
string(%d) "%s"
--DATE_RFC822 Constant--
@@ -79,4 +79,4 @@ string(%d) "%s"
--DATE_W3C Constant--
string(25) "2008-08-08T08:08:08+00:00"
string(%d) "%s"
-===DONE=== \ No newline at end of file
+===DONE===
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt
new file mode 100644
index 000000000..fdbe96d7d
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt
@@ -0,0 +1,96 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, ba)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Backward Transitions, add().
+ */
+
+$start = new DateTime('2010-11-07 01:59:59');
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'ba1 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT24H';
+$interval = new DateInterval($interval_spec);
+echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT23H';
+$interval = new DateInterval($interval_spec);
+echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT22H';
+$interval = new DateInterval($interval_spec);
+echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT21H';
+$interval = new DateInterval($interval_spec);
+echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 01:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 01:30:00');
+$interval_spec = 'P1DT1H';
+$interval = new DateInterval($interval_spec);
+echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 04:30:00');
+$interval_spec = 'PT25H';
+$interval = new DateInterval($interval_spec);
+echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 03:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-11-06 02:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+echo "\n";
+
+?>
+--EXPECT--
+ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York
+ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York
+ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York
+ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST America/New_York
+ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York
+ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York
+ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York
+ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 02:30:00 EST America/New_York
+ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York
+ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York
+ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt
new file mode 100644
index 000000000..824959993
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt
@@ -0,0 +1,48 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd1)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Backward Transitions, diff().
+ */
+
+$end = new DateTime('2010-11-07 05:30:00');
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 04:30:00');
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 03:30:00');
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 02:30:00');
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00');
+$start = new DateTime('2010-11-06 01:30:00');
+echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+echo "\n";
+?>
+--EXPECT--
+bd1 2010-11-07 05:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT1H
+bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H
+bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H
+bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H
+bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt
new file mode 100644
index 000000000..fe2e79b3b
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt
@@ -0,0 +1,56 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--XFAIL--
+Still not quite right
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * For backward transitions, must create objects with zone type 2
+ * where specifying Daylight or Standard time is required
+ * then converting them to zone type 3.
+ */
+
+$tz = new DateTimeZone('America/New_York');
+
+/*
+ * Backward Transitions, diff().
+ */
+
+$end = new DateTime('2010-11-07 05:30:00');
+$end->setTimeZone($tz);
+$start = new DateTime('2010-11-06 04:30:59');
+echo 'bd0 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format('P%dDT%hH%iM%sS') . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EST');
+$end->setTimeZone($tz);
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EDT');
+$end->setTimeZone($tz);
+$start = new DateTime('2010-11-06 04:30:00');
+echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EST');
+$end->setTimeZone($tz);
+$start = new DateTime('2010-11-06 01:30:00');
+echo 'bd8 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+echo "\n";
+?>
+--EXPECT--
+bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S
+bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H
+bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
+bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt
new file mode 100644
index 000000000..138c68f3a
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt
@@ -0,0 +1,92 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bs)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$tz = new DateTimeZone('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Backward Transitions, sub().
+ */
+
+$end = new DateTime('2010-11-07 01:00:00 EST');
+$end->setTimeZone($tz);
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'bs1 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 04:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'bs2 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 03:30:00');
+$interval_spec = 'PT24H';
+$interval = new DateInterval($interval_spec);
+echo 'bs3 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 02:30:00');
+$interval_spec = 'PT23H';
+$interval = new DateInterval($interval_spec);
+echo 'bs4 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EST');
+$end->setTimeZone($tz);
+$interval_spec = 'PT22H';
+$interval = new DateInterval($interval_spec);
+echo 'bs5 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EDT');
+$end->setTimeZone($tz);
+$interval_spec = 'PT21H';
+$interval = new DateInterval($interval_spec);
+echo 'bs6 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'bs7 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 01:30:00 EST');
+$end->setTimeZone($tz);
+$interval_spec = 'P1DT1H';
+$interval = new DateInterval($interval_spec);
+echo 'bs8 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 03:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'bs9 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-11-07 02:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'bs10 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+?>
+--EXPECT--
+bs1 2010-11-07 01:00:00 EST America/New_York - PT1S = 2010-11-07 01:59:59 EDT America/New_York
+bs2 2010-11-07 04:30:00 EST America/New_York - P1D = 2010-11-06 04:30:00 EDT America/New_York
+bs3 2010-11-07 03:30:00 EST America/New_York - PT24H = 2010-11-06 04:30:00 EDT America/New_York
+bs4 2010-11-07 02:30:00 EST America/New_York - PT23H = 2010-11-06 04:30:00 EDT America/New_York
+bs5 2010-11-07 01:30:00 EST America/New_York - PT22H = 2010-11-06 04:30:00 EDT America/New_York
+bs6 2010-11-07 01:30:00 EDT America/New_York - PT21H = 2010-11-06 04:30:00 EDT America/New_York
+bs7 2010-11-07 01:30:00 EDT America/New_York - P1D = 2010-11-06 01:30:00 EDT America/New_York
+bs8 2010-11-07 01:30:00 EST America/New_York - P1DT1H = 2010-11-06 00:30:00 EDT America/New_York
+bs9 2010-11-07 03:30:00 EST America/New_York - P1D = 2010-11-06 03:30:00 EDT America/New_York
+bs10 2010-11-07 02:30:00 EST America/New_York - P1D = 2010-11-06 02:30:00 EDT America/New_York
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt
new file mode 100644
index 000000000..9fa493f57
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt
@@ -0,0 +1,58 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fa)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Forward Transitions, add().
+ */
+
+$start = new DateTime('2010-03-14 01:59:59');
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 04:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 04:30:00');
+$interval_spec = 'PT22H';
+$interval = new DateInterval($interval_spec);
+echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 04:30:00');
+$interval_spec = 'PT21H';
+$interval = new DateInterval($interval_spec);
+echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 01:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+
+$start = new DateTime('2010-03-13 02:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = "
+ . $start->add($interval)->format($date_format) . "\n";
+?>
+--EXPECT--
+fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York
+fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York
+fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York
+fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York
+fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York
+fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt
new file mode 100644
index 000000000..ae7060be0
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt
@@ -0,0 +1,58 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fd)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Forward Transitions, diff().
+ */
+
+$end = new DateTime('2010-03-14 03:00:00');
+$start = new DateTime('2010-03-14 01:59:59');
+echo 'fd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
+
+$end = new DateTime('2010-03-14 04:30:00');
+$start = new DateTime('2010-03-13 04:30:00');
+echo 'fd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 03:30:00');
+$start = new DateTime('2010-03-13 04:30:00');
+echo 'fd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 01:30:00');
+$start = new DateTime('2010-03-13 04:30:00');
+echo 'fd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 01:30:00');
+$start = new DateTime('2010-03-13 01:30:00');
+echo 'fd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 03:30:00');
+$start = new DateTime('2010-03-13 03:30:00');
+echo 'fd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+
+$end = new DateTime('2010-03-14 03:30:00');
+$start = new DateTime('2010-03-13 02:30:00');
+echo 'fd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
+ . ' = ' . $start->diff($end)->format($interval_format) . "\n";
+?>
+--EXPECT--
+fd1 2010-03-14 03:00:00 EDT America/New_York - 2010-03-14 01:59:59 EST America/New_York = PT0H0M1S
+fd2 2010-03-14 04:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P1DT0H
+fd3 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT22H
+fd4 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT21H
+fd5 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 01:30:00 EST America/New_York = P1DT0H
+fd6 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 03:30:00 EST America/New_York = P1DT0H
+fd7 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 02:30:00 EST America/New_York = P1DT1H
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
new file mode 100644
index 000000000..72351d37e
--- /dev/null
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
@@ -0,0 +1,67 @@
+--TEST--
+RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs)
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+--XFAIL--
+Still not quite right
+--FILE--
+<?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Forward Transitions, sub().
+ */
+
+$end = new DateTime('2010-03-14 03:00:00');
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'fs1 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-14 04:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fs2 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-14 03:30:00');
+$interval_spec = 'PT22H';
+$interval = new DateInterval($interval_spec);
+echo 'fs3 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-14 01:30:00');
+$interval_spec = 'PT21H';
+$interval = new DateInterval($interval_spec);
+echo 'fs4 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-14 01:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fs5 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-15 03:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fs6 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+
+$end = new DateTime('2010-03-15 02:30:00');
+$interval_spec = 'P1D';
+$interval = new DateInterval($interval_spec);
+echo 'fs7 ' . $end->format($date_format) . " - $interval_spec = "
+ . $end->sub($interval)->format($date_format) . "\n";
+?>
+--EXPECT--
+fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York
+fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York
+fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York
+fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York
+fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York
+fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
+fs7 2010-03-15 02:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt
deleted file mode 100644
index 855fe4ef6..000000000
--- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt
+++ /dev/null
@@ -1,399 +0,0 @@
---TEST--
-RFC: DateTime and Daylight Saving Time Transitions (zone type 3)
---CREDITS--
-Daniel Convissor <danielc@php.net>
---XFAIL--
-RFC not implemented yet
---FILE--
-<?php
-
-date_default_timezone_set('America/New_York');
-$date_format = 'Y-m-d H:i:s T e';
-$interval_format = 'P%dDT%hH';
-
-/*
- * Forward Transitions, diff().
- */
-
-$end = new DateTime('2010-03-14 03:00:00');
-$start = new DateTime('2010-03-14 01:59:59');
-echo 'fd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
-
-$end = new DateTime('2010-03-14 04:30:00');
-$start = new DateTime('2010-03-13 04:30:00');
-echo 'fd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 03:30:00');
-$start = new DateTime('2010-03-13 04:30:00');
-echo 'fd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 01:30:00');
-$start = new DateTime('2010-03-13 04:30:00');
-echo 'fd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 01:30:00');
-$start = new DateTime('2010-03-13 01:30:00');
-echo 'fd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 03:30:00');
-$start = new DateTime('2010-03-13 03:30:00');
-echo 'fd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-03-14 03:30:00');
-$start = new DateTime('2010-03-13 02:30:00');
-echo 'fd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-echo "\n";
-
-/*
- * Forward Transitions, add().
- */
-
-$start = new DateTime('2010-03-14 01:59:59');
-$interval_spec = 'PT1S';
-$interval = new DateInterval($interval_spec);
-echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 04:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 04:30:00');
-$interval_spec = 'PT22H';
-$interval = new DateInterval($interval_spec);
-echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 04:30:00');
-$interval_spec = 'PT21H';
-$interval = new DateInterval($interval_spec);
-echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 01:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-03-13 02:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-echo "\n";
-
-/*
- * Forward Transitions, sub().
- */
-
-$end = new DateTime('2010-03-14 03:00:00');
-$interval_spec = 'PT1S';
-$interval = new DateInterval($interval_spec);
-echo 'fs1 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-14 04:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fs2 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-14 03:30:00');
-$interval_spec = 'PT22H';
-$interval = new DateInterval($interval_spec);
-echo 'fs3 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-14 01:30:00');
-$interval_spec = 'PT21H';
-$interval = new DateInterval($interval_spec);
-echo 'fs4 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-14 01:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fs5 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-15 03:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fs6 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-03-15 02:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'fs7 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-echo "\n";
-
-
-/*
- * For backward transitions, must create objects with zone type 2
- * where specifying Daylight or Standard time is required
- * then converting them to zone type 3.
- */
-
-$tz = new DateTimeZone('America/New_York');
-
-/*
- * Backward Transitions, diff().
- */
-
-$end = new DateTime('2010-11-07 01:00:00 EST');
-$end->setTimeZone($tz);
-$start = new DateTime('2010-11-07 01:59:59');
-echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
-
-$end = new DateTime('2010-11-07 04:30:00');
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 03:30:00');
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 02:30:00');
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EST');
-$end->setTimeZone($tz);
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EDT');
-$end->setTimeZone($tz);
-$start = new DateTime('2010-11-06 04:30:00');
-echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00');
-$start = new DateTime('2010-11-06 01:30:00');
-echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EST');
-$end->setTimeZone($tz);
-$start = new DateTime('2010-11-06 01:30:00');
-echo 'bd8 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
- . ' = ' . $start->diff($end)->format($interval_format) . "\n";
-
-echo "\n";
-
-/*
- * Backward Transitions, add().
- */
-
-$start = new DateTime('2010-11-07 01:59:59');
-$interval_spec = 'PT1S';
-$interval = new DateInterval($interval_spec);
-echo 'ba1 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT24H';
-$interval = new DateInterval($interval_spec);
-echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT23H';
-$interval = new DateInterval($interval_spec);
-echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT22H';
-$interval = new DateInterval($interval_spec);
-echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT21H';
-$interval = new DateInterval($interval_spec);
-echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 01:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 01:30:00');
-$interval_spec = 'P1DT1H';
-$interval = new DateInterval($interval_spec);
-echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 04:30:00');
-$interval_spec = 'PT25H';
-$interval = new DateInterval($interval_spec);
-echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 03:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-$start = new DateTime('2010-11-06 02:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = "
- . $start->add($interval)->format($date_format) . "\n";
-
-echo "\n";
-
-/*
- * Backward Transitions, sub().
- */
-
-$end = new DateTime('2010-11-07 01:00:00 EST');
-$end->setTimeZone($tz);
-$interval_spec = 'PT1S';
-$interval = new DateInterval($interval_spec);
-echo 'bs1 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 04:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'bs2 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 03:30:00');
-$interval_spec = 'PT24H';
-$interval = new DateInterval($interval_spec);
-echo 'bs3 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 02:30:00');
-$interval_spec = 'PT23H';
-$interval = new DateInterval($interval_spec);
-echo 'bs4 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EST');
-$end->setTimeZone($tz);
-$interval_spec = 'PT22H';
-$interval = new DateInterval($interval_spec);
-echo 'bs5 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EDT');
-$end->setTimeZone($tz);
-$interval_spec = 'PT21H';
-$interval = new DateInterval($interval_spec);
-echo 'bs6 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'bs7 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 01:30:00 EST');
-$end->setTimeZone($tz);
-$interval_spec = 'P1DT1H';
-$interval = new DateInterval($interval_spec);
-echo 'bs8 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 03:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'bs9 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-$end = new DateTime('2010-11-07 02:30:00');
-$interval_spec = 'P1D';
-$interval = new DateInterval($interval_spec);
-echo 'bs10 ' . $end->format($date_format) . " - $interval_spec = "
- . $end->sub($interval)->format($date_format) . "\n";
-
-?>
---EXPECT--
-fd1 2010-03-14 03:00:00 EDT America/New_York - 2010-03-14 01:59:59 EST America/New_York = PT0H0M1S
-fd2 2010-03-14 04:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P1DT0H
-fd3 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT22H
-fd4 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT21H
-fd5 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 01:30:00 EST America/New_York = P1DT0H
-fd6 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 03:30:00 EST America/New_York = P1DT0H
-fd7 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 02:30:00 EST America/New_York = P1DT1H
-
-fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York
-fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York
-fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York
-fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York
-fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York
-fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York
-
-fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York
-fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York
-fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York
-fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York
-fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York
-fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
-fs7 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
-
-bd1 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S
-bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H
-bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H
-bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H
-bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H
-bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
-bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H
-bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H
-
-ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York
-ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York
-ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York
-ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST America/New_York
-ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York
-ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York
-ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York
-ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 01:30:00 EST America/New_York
-ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York
-ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York
-ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York
-
-bs1 2010-11-07 01:00:00 EST America/New_York - PT1S = 2010-11-07 01:59:59 EDT America/New_York
-bs2 2010-11-07 04:30:00 EST America/New_York - P1D = 2010-11-06 04:30:00 EDT America/New_York
-bs3 2010-11-07 03:30:00 EST America/New_York - PT24H = 2010-11-06 04:30:00 EDT America/New_York
-bs4 2010-11-07 02:30:00 EST America/New_York - PT23H = 2010-11-06 04:30:00 EDT America/New_York
-bs5 2010-11-07 01:30:00 EST America/New_York - PT22H = 2010-11-06 04:30:00 EDT America/New_York
-bs6 2010-11-07 01:30:00 EDT America/New_York - PT21H = 2010-11-06 04:30:00 EDT America/New_York
-bs7 2010-11-07 01:30:00 EDT America/New_York - P1D = 2010-11-06 01:30:00 EDT America/New_York
-bs8 2010-11-07 01:30:00 EST America/New_York - P1DT1H = 2010-11-06 00:30:00 EDT America/New_York
-bs9 2010-11-07 03:30:00 EST America/New_York - P1D = 2010-11-06 03:30:00 EDT America/New_York
-bs10 2010-11-07 02:30:00 EST America/New_York - P1D = 2010-11-06 02:30:00 EDT America/New_York
diff --git a/ext/date/tests/strtotime3-64bit.phpt b/ext/date/tests/strtotime3-64bit.phpt
index 7dc081635..3a47659f8 100644
--- a/ext/date/tests/strtotime3-64bit.phpt
+++ b/ext/date/tests/strtotime3-64bit.phpt
@@ -53,7 +53,7 @@ bool(false)
string(31) "Fri, 16 Jun 2006 23:49:12 +0100"
bool(false)
string(31) "Fri, 16 Jun 2006 02:22:00 +0100"
-string(31) "Mon, 16 Jun 0222 02:22:00 -0036"
+string(31) "Sun, 16 Jun 0222 02:22:00 -0036"
string(31) "Fri, 16 Jun 2006 02:22:33 +0100"
bool(false)
string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
diff --git a/ext/date/tests/test-parse-from-format.phpt b/ext/date/tests/test-parse-from-format.phpt
index 2bf9c4e1b..5bb5fe532 100644
--- a/ext/date/tests/test-parse-from-format.phpt
+++ b/ext/date/tests/test-parse-from-format.phpt
@@ -32,8 +32,8 @@ object(DateTime)#2 (3) {
string(6) "+02:00"
}
-string(16) "l, d-M-y H:i:s T"
-string(36) "Tuesday, 08-Jul-08 22:14:12 GMT+0200"
+string(16) "l, d-M-Y H:i:s T"
+string(38) "Tuesday, 08-Jul-2008 22:14:12 GMT+0200"
object(DateTime)#1 (3) {
["date"]=>
string(19) "2008-07-08 22:14:12"
diff --git a/ext/dom/document.c b/ext/dom/document.c
index efe6d9070..cca77ff9d 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -2304,7 +2304,7 @@ PHP_FUNCTION(dom_document_save_html)
xmlBufferPtr buf;
dom_object *intern, *nodeobj;
xmlChar *mem = NULL;
- int size, format;
+ int size = 0, format;
dom_doc_propsptr doc_props;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
@@ -2332,7 +2332,22 @@ PHP_FUNCTION(dom_document_save_html)
RETURN_FALSE;
}
- size = htmlNodeDump(buf, docp, node);
+ if (node->type == XML_DOCUMENT_FRAG_NODE) {
+ int one_size;
+
+ for (node = node->children; node; node = node->next) {
+ one_size = htmlNodeDump(buf, docp, node);
+
+ if (one_size >= 0) {
+ size += one_size;
+ } else {
+ size = -1;
+ break;
+ }
+ }
+ } else {
+ size = htmlNodeDump(buf, docp, node);
+ }
if (size >= 0) {
mem = (xmlChar*) xmlBufferContent(buf);
if (!mem) {
diff --git a/ext/dom/tests/bug65196.phpt b/ext/dom/tests/bug65196.phpt
new file mode 100644
index 000000000..c77f97222
--- /dev/null
+++ b/ext/dom/tests/bug65196.phpt
@@ -0,0 +1,26 @@
+--TEST--
+bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML() Produces invalid Markup)
+--SKIPIF--
+<?php
+extension_loaded("dom") or die("skip need ext/dom");
+?>
+--FILE--
+<?php
+$dom = new DOMDocument();
+
+$frag1 = $dom->createDocumentFragment();
+var_dump($dom->saveHTML($frag1));
+
+$frag2 = $dom->createDocumentFragment();
+$div = $dom->createElement('div');
+$div->appendChild($dom->createElement('span'));
+$frag2->appendChild($div);
+$frag2->appendChild($dom->createElement('div'));
+$frag2->appendChild($dom->createElement('div'));
+var_dump($dom->saveHTML($frag2));
+?>
+===DONE===
+--EXPECT--
+string(0) ""
+string(46) "<div><span></span></div><div></div><div></div>"
+===DONE===
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 2fe54f7b3..c531d8dfa 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -2852,7 +2852,12 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel);
/* If its bigger than 4 bytes, the dir entry contains an offset. */
value_ptr = offset_base+offset_val;
- if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry) {
+ /*
+ dir_entry is ImageInfo->file.list[sn].data+2+i*12
+ offset_base is ImageInfo->file.list[sn].data-dir_offset
+ dir_entry - offset_base is dir_offset+2+i*12
+ */
+ if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) {
/* It is important to check for IMAGE_FILETYPE_TIFF
* JPEG does not use absolute pointers instead its pointers are
* relative to the start of the TIFF header in APP1 section. */
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 39433d6ec..a6c8056ac 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -715,8 +715,6 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (
(ip[0] == 0) ||
(ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) ||
- (ip[0] == 128 && ip[1] == 0) ||
- (ip[0] == 191 && ip[1] == 255) ||
(ip[0] == 169 && ip[1] == 254) ||
(ip[0] == 192 && ip[1] == 0 && ip[2] == 2) ||
(ip[0] == 127 && ip[1] == 0 && ip[2] == 0 && ip[3] == 1) ||
diff --git a/ext/filter/tests/bug53150.phpt b/ext/filter/tests/bug53150.phpt
index 4baa4db77..4906888bd 100644
--- a/ext/filter/tests/bug53150.phpt
+++ b/ext/filter/tests/bug53150.phpt
@@ -23,6 +23,6 @@ string(3) "::1"
bool(false)
bool(false)
string(9) "128.0.0.1"
-bool(false)
+string(9) "128.0.0.1"
+string(11) "191.255.0.0"
string(11) "191.255.0.0"
-bool(false)
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
index c9e080faa..446c2425a 100644
--- a/ext/gd/config.m4
+++ b/ext/gd/config.m4
@@ -185,30 +185,25 @@ AC_DEFUN([PHP_GD_FREETYPE2],[
if test "$PHP_FREETYPE_DIR" != "no"; then
for i in $PHP_FREETYPE_DIR /usr/local /usr; do
- if test -f "$i/include/freetype2/freetype/freetype.h"; then
+ if test -f "$i/bin/freetype-config"; then
FREETYPE2_DIR=$i
- FREETYPE2_INC_DIR=$i/include/freetype2
+ FREETYPE2_CONFIG="$i/bin/freetype-config"
break
fi
done
if test -z "$FREETYPE2_DIR"; then
- AC_MSG_ERROR([freetype.h not found.])
+ AC_MSG_ERROR([freetype-config not found.])
fi
- PHP_CHECK_LIBRARY(freetype, FT_New_Face,
- [
- PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
- PHP_ADD_INCLUDE($FREETYPE2_DIR/include)
- PHP_ADD_INCLUDE($FREETYPE2_INC_DIR)
- AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
- AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
- AC_DEFINE(ENABLE_GD_TTF,1,[ ])
- ],[
- AC_MSG_ERROR([Problem with freetype.(a|so). Please check config.log for more information.])
- ],[
- -L$FREETYPE2_DIR/$PHP_LIBDIR
- ])
+ FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
+ FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
+
+ PHP_EVAL_INCLINE($FREETYPE2_CFLAGS)
+ PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD)
+ AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
+ AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
+ AC_DEFINE(ENABLE_GD_TTF,1,[ ])
else
AC_MSG_RESULT([If configure fails try --with-freetype-dir=<DIR>])
fi
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index c24b974de..b5630c3e7 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -775,7 +775,7 @@ PHP_FUNCTION(mysqli_poll)
MYSQLND **new_r_array = NULL, **new_e_array = NULL, **new_dont_poll_array = NULL;
long sec = 0, usec = 0;
enum_func_status ret;
- uint desc_num;
+ int desc_num;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!al|l", &r_array, &e_array, &dont_poll_array, &sec, &usec) == FAILURE) {
return;
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 6e17412ed..9e3e6e72d 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -1340,7 +1340,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
/* {{{ _mysqlnd_poll */
PHPAPI enum_func_status
-_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC)
+_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC)
{
struct timeval tv;
struct timeval *tv_p = NULL;
diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h
index 40933630e..1514feb37 100644
--- a/ext/mysqlnd/mysqlnd.h
+++ b/ext/mysqlnd/mysqlnd.h
@@ -117,7 +117,7 @@ PHPAPI void _mysqlnd_debug(const char *mode TSRMLS_DC);
#define mysqlnd_reap_async_query(conn) ((conn)->data)->m->reap_query((conn)->data TSRMLS_CC)
#define mysqlnd_unbuffered_skip_result(result) (result)->m.skip_result((result) TSRMLS_CC)
-PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC);
+PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC);
#define mysqlnd_use_result(conn) ((conn)->data)->m->use_result((conn)->data TSRMLS_CC)
#define mysqlnd_store_result(conn) ((conn)->data)->m->store_result((conn)->data TSRMLS_CC)
diff --git a/ext/opcache/README b/ext/opcache/README
index cb6ac342c..693a7b4e3 100644
--- a/ext/opcache/README
+++ b/ext/opcache/README
@@ -40,7 +40,8 @@ after OPcache.
Speed Tuning
-------------
-We recommend the following configuration options for best performance.
+We recommend the following configuration options for best performance
+in a production environment.
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
@@ -59,6 +60,9 @@ opcache.enable_file_override=1
In some cases you may like to prefer enabling/disabling some features
to avoid incompatibilities at the cost of some performance degradation.
+For development environment we would recommend setting opcache.revalidate_freq
+into 0.
+
Configuration Directives
------------------------
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index c0edf7e47..9662c9912 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -877,7 +877,7 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
return FAILURE;
}
-static inline int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC)
+int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC)
{
if (ZCG(accel_directives).revalidate_freq &&
(persistent_script->dynamic_members.revalidate >= ZCSG(revalidate_at))) {
@@ -1153,8 +1153,9 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
zend_persistent_script *existing_persistent_script = (zend_persistent_script *)bucket->data;
if (!existing_persistent_script->corrupted) {
- if (!ZCG(accel_directives).validate_timestamps ||
- (new_persistent_script->timestamp == existing_persistent_script->timestamp)) {
+ if (!ZCG(accel_directives).revalidate_path &&
+ (!ZCG(accel_directives).validate_timestamps ||
+ (new_persistent_script->timestamp == existing_persistent_script->timestamp))) {
zend_accel_add_key(key, key_length, bucket TSRMLS_CC);
}
zend_shared_alloc_unlock(TSRMLS_C);
@@ -1195,7 +1196,7 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
/* store script structure in the hash table */
bucket = zend_accel_hash_update(&ZCSG(hash), new_persistent_script->full_path, new_persistent_script->full_path_len + 1, 0, new_persistent_script);
- if (bucket &&
+ if (bucket && !ZCG(accel_directives).revalidate_path &&
/* key may contain non-persistent PHAR aliases (see issues #115 and #149) */
memcmp(key, "phar://", sizeof("phar://") - 1) != 0 &&
(new_persistent_script->full_path_len != key_length ||
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index cbc50d2b7..dbda3b382 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -330,6 +330,7 @@ extern char *zps_api_failure_reason;
void accel_shutdown(TSRMLS_D);
void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC);
void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC);
+int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC);
int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC);
int accelerator_shm_read_lock(TSRMLS_D);
void accelerator_shm_read_unlock(TSRMLS_D);
diff --git a/ext/opcache/tests/issue0140.phpt b/ext/opcache/tests/issue0140.phpt
new file mode 100644
index 000000000..7c0d6b92b
--- /dev/null
+++ b/ext/opcache/tests/issue0140.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Issue #140: "opcache.enable_file_override" doesn't respect "opcache.revalidate_freq"
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.revalidate_freq=0
+opcache.file_update_protection=0
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
+--FILE--
+<?php
+define("FILENAME", dirname(__FILE__) . "/issuer0140.inc.php");
+file_put_contents(FILENAME, "1\n");
+
+var_dump(is_readable(FILENAME));
+include(FILENAME);
+var_dump(filemtime(FILENAME));
+
+sleep(2);
+file_put_contents(FILENAME, "2\n");
+
+var_dump(is_readable(FILENAME));
+include(FILENAME);
+var_dump(filemtime(FILENAME));
+
+sleep(2);
+unlink(FILENAME);
+
+var_dump(is_readable(FILENAME));
+var_dump(@include(FILENAME));
+var_dump(@filemtime(FILENAME));
+?>
+--EXPECTF--
+bool(true)
+1
+int(%d)
+bool(true)
+2
+int(%d)
+bool(false)
+bool(false)
+bool(false)
diff --git a/ext/opcache/tests/revalidate_path_01.phpt b/ext/opcache/tests/revalidate_path_01.phpt
new file mode 100644
index 000000000..cf2ac0d82
--- /dev/null
+++ b/ext/opcache/tests/revalidate_path_01.phpt
@@ -0,0 +1,61 @@
+--TEST--
+revalidate_path 01: OPCache must cache only resolved real paths when revalidate_path is set
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.revalidate_path=1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
+--FILE--
+<?php
+$dir = dirname(__FILE__);
+$dir1 = "$dir/test1";
+$dir2 = "$dir/test2";
+$link = "$dir/test";
+$file1 = "$dir1/index.php";
+$file2 = "$dir2/index.php";
+$main = "$dir/main.php";
+@mkdir($dir1);
+@mkdir($dir2);
+@file_put_contents($main, '<?php include(\'' . $link .'/index.php\');');
+@file_put_contents($file1, "TEST 1\n");
+@file_put_contents($file2, "TEST 2\n");
+while (filemtime($file1) != filemtime($file2)) {
+ touch($file1);
+ touch($file2);
+}
+@unlink($link);
+@symlink($dir1, $link);
+
+include "php_cli_server.inc";
+//php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.revalidate_path=1');
+php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.revalidate_path=1 -d opcache.file_update_protection=0 -d realpath_cache_size=0');
+echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/main.php');
+echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/main.php');
+@unlink($link);
+@symlink($dir2, $link);
+echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/main.php');
+echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/main.php');
+?>
+--CLEAN--
+<?php
+$dir = dirname(__FILE__);
+$dir1 = "$dir/test1";
+$dir2 = "$dir/test2";
+$link = "$dir/test";
+$file1 = "$dir1/index.php";
+$file2 = "$dir2/index.php";
+$main = "$dir/main.php";
+@unlink($main);
+@unlink($link);
+@unlink($file1);
+@unlink($file2);
+@rmdir($dir1);
+@rmdir($dir2);
+?>
+--EXPECT--
+TEST 1
+TEST 1
+TEST 2
+TEST 2
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index c3df1a68f..36d02cc07 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -313,13 +313,15 @@ static int filename_is_in_cache(char *filename, int filename_len TSRMLS_DC)
if (IS_ABSOLUTE_PATH(filename, filename_len)) {
persistent_script = zend_accel_hash_find(&ZCSG(hash), filename, filename_len + 1);
if (persistent_script) {
- return !persistent_script->corrupted;
+ return !persistent_script->corrupted &&
+ validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
}
}
if ((key = accel_make_persistent_key_ex(&handle, filename_len, &key_length TSRMLS_CC)) != NULL) {
persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length + 1);
- return persistent_script && !persistent_script->corrupted;
+ return persistent_script && !persistent_script->corrupted &&
+ validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
}
return 0;
diff --git a/ext/openssl/tests/cve-2013-6420.phpt b/ext/openssl/tests/cve-2013-6420.phpt
index b946cf0dd..87c0210b2 100644
--- a/ext/openssl/tests/cve-2013-6420.phpt
+++ b/ext/openssl/tests/cve-2013-6420.phpt
@@ -12,7 +12,7 @@ var_dump($info['issuer']['emailAddress'], $info["validFrom_time_t"]);
?>
Done
--EXPECTF--
-%s openssl_x509_parse(): illegal ASN1 data type for timestamp in %s/cve-2013-6420.php on line 3
+%s openssl_x509_parse(): illegal ASN1 data type for timestamp in %s%ecve-2013-6420.php on line 3
string(27) "stefan.esser@sektioneins.de"
int(-1)
Done
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index a1a7ffc3f..1d1c91f13 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -825,7 +825,7 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS
case PHP_STREAM_AS_FD_FOR_SELECT:
if (ret) {
- *(int *)ret = sslsock->s.socket;
+ *(php_socket_t *)ret = sslsock->s.socket;
}
return SUCCESS;
@@ -835,7 +835,7 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS
return FAILURE;
}
if (ret) {
- *(int *)ret = sslsock->s.socket;
+ *(php_socket_t *)ret = sslsock->s.socket;
}
return SUCCESS;
default:
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
index 0e3fd3cbb..e0d7e62f2 100644
--- a/ext/pdo_odbc/odbc_stmt.c
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -472,7 +472,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
if (P->outbuf) {
unsigned long ulen;
char *srcbuf;
- unsigned long srclen;
+ unsigned long srclen = 0;
switch (P->len) {
case SQL_NULL_DATA:
@@ -551,7 +551,8 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
struct pdo_column_data *col = &stmt->columns[colno];
RETCODE rc;
SWORD colnamelen;
- SDWORD colsize, displaysize;
+ SDWORD colsize;
+ SQLLEN displaysize;
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
sizeof(S->cols[colno].colname)-1, &colnamelen,
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index b1f7484f2..e6cef1dfe 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1105,29 +1105,26 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
string_free(&str_constants);
}
- if (module->functions && module->functions->fname) {
+ {
+ HashPosition iterator;
zend_function *fptr;
- const zend_function_entry *func = module->functions;
-
- string_printf(str, "\n - Functions {\n");
-
- /* Is there a better way of doing this? */
- while (func->fname) {
- int fname_len = strlen(func->fname);
- char *lc_name = zend_str_tolower_dup(func->fname, fname_len);
-
- if (zend_hash_find(EG(function_table), lc_name, fname_len + 1, (void**) &fptr) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname);
- func++;
- efree(lc_name);
- continue;
+ int first = 1;
+
+ zend_hash_internal_pointer_reset_ex(CG(function_table), &iterator);
+ while (zend_hash_get_current_data_ex(CG(function_table), (void **) &fptr, &iterator) == SUCCESS) {
+ if (fptr->common.type==ZEND_INTERNAL_FUNCTION
+ && fptr->internal_function.module == module) {
+ if (first) {
+ string_printf(str, "\n - Functions {\n");
+ first = 0;
+ }
+ _function_string(str, fptr, NULL, " " TSRMLS_CC);
}
-
- _function_string(str, fptr, NULL, " " TSRMLS_CC);
- efree(lc_name);
- func++;
+ zend_hash_move_forward_ex(CG(function_table), &iterator);
+ }
+ if (!first) {
+ string_printf(str, "%s }\n", indent);
}
- string_printf(str, "%s }\n", indent);
}
{
@@ -5264,6 +5261,9 @@ ZEND_METHOD(reflection_extension, getFunctions)
{
reflection_object *intern;
zend_module_entry *module;
+ HashPosition iterator;
+ zval *function;
+ zend_function *fptr;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -5271,29 +5271,15 @@ ZEND_METHOD(reflection_extension, getFunctions)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- if (module->functions) {
- zval *function;
- zend_function *fptr;
- const zend_function_entry *func = module->functions;
-
- /* Is there a better way of doing this? */
- while (func->fname) {
- int fname_len = strlen(func->fname);
- char *lc_name = zend_str_tolower_dup(func->fname, fname_len);
-
- if (zend_hash_find(EG(function_table), lc_name, fname_len + 1, (void**) &fptr) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname);
- func++;
- efree(lc_name);
- continue;
- }
-
+ zend_hash_internal_pointer_reset_ex(CG(function_table), &iterator);
+ while (zend_hash_get_current_data_ex(CG(function_table), (void **) &fptr, &iterator) == SUCCESS) {
+ if (fptr->common.type==ZEND_INTERNAL_FUNCTION
+ && fptr->internal_function.module == module) {
ALLOC_ZVAL(function);
reflection_function_factory(fptr, NULL, function TSRMLS_CC);
- add_assoc_zval_ex(return_value, func->fname, fname_len+1, function);
- func++;
- efree(lc_name);
+ add_assoc_zval(return_value, fptr->common.function_name, function);
}
+ zend_hash_move_forward_ex(CG(function_table), &iterator);
}
}
/* }}} */
diff --git a/ext/reflection/tests/ReflectionExtension_bug66218.phpt b/ext/reflection/tests/ReflectionExtension_bug66218.phpt
new file mode 100644
index 000000000..e263624ba
--- /dev/null
+++ b/ext/reflection/tests/ReflectionExtension_bug66218.phpt
@@ -0,0 +1,21 @@
+--TEST--
+ReflectionExtension::getFunctions() ##6218 zend_register_functions breaks reflection
+--SKIPIF--
+<?php
+if (!extension_loaded('reflection')) print 'skip missing reflection extension';
+if (PHP_SAPI != "cli") die("skip CLI only test");
+if (!function_exists("dl")) die("skip need dl");
+?>
+--FILE--
+<?php
+$r = new ReflectionExtension('standard');
+$t = $r->getFunctions();
+var_dump($t['dl']);
+?>
+Done
+--EXPECTF--
+object(ReflectionFunction)#%d (1) {
+ ["name"]=>
+ string(2) "dl"
+}
+Done
diff --git a/ext/session/tests/session_name_error.phpt b/ext/session/tests/session_name_error.phpt
index 1b99d4ea3..9f0101d98 100644
--- a/ext/session/tests/session_name_error.phpt
+++ b/ext/session/tests/session_name_error.phpt
@@ -231,6 +231,6 @@ string(12) "Hello World!"
-- Iteration 24 --
Warning: session_name() expects parameter 1 to be string, resource given in %s on line %d
-resource(5) of type (stream)
+resource(%d) of type (stream)
NULL
Done \ No newline at end of file
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 4e2510afc..1b634e0cd 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -533,7 +533,7 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type,
}
if (object && (snmp_object->exceptions_enabled & type)) {
- zend_throw_exception_ex(php_snmp_exception_ce, type, snmp_object->snmp_errstr TSRMLS_CC);
+ zend_throw_exception_ex(php_snmp_exception_ce, type TSRMLS_CC, snmp_object->snmp_errstr);
} else {
va_start(args, format);
php_verror(docref, "", E_WARNING, format, args TSRMLS_CC);
@@ -896,6 +896,12 @@ retry:
keepwalking = 1;
}
} else {
+ if (st & SNMP_CMD_WALK && response->errstat == SNMP_ERR_TOOBIG && objid_query->max_repetitions > 1) { /* Answer will not fit into single packet */
+ objid_query->max_repetitions /= 2;
+ snmp_free_pdu(response);
+ keepwalking = 1;
+ continue;
+ }
if (!(st & SNMP_CMD_WALK) || response->errstat != SNMP_ERR_NOSUCHNAME || Z_TYPE_P(return_value) == IS_BOOL) {
for ( count=1, vars = response->variables;
vars && count != response->errindex;
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 00e80efbc..3176cfc9a 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2546,7 +2546,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
int ret = TRUE;
char *buf;
int buf_size;
- zval func, param0, param1, param2, param3, param4;
+ zval func;
zval *params[5];
zval **trace;
zval **fault;
@@ -2566,29 +2566,24 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
INIT_ZVAL(func);
ZVAL_STRINGL(&func,"__doRequest",sizeof("__doRequest")-1,0);
- INIT_ZVAL(param0);
- params[0] = &param0;
- ZVAL_STRINGL(params[0], buf, buf_size, 0);
- INIT_ZVAL(param1);
- params[1] = &param1;
+ ALLOC_INIT_ZVAL(params[0]);
+ ZVAL_STRINGL(params[0], buf, buf_size, 1);
+ ALLOC_INIT_ZVAL(params[1]);
if (location == NULL) {
ZVAL_NULL(params[1]);
} else {
- ZVAL_STRING(params[1], location, 0);
+ ZVAL_STRING(params[1], location, 1);
}
- INIT_ZVAL(param2);
- params[2] = &param2;
+ ALLOC_INIT_ZVAL(params[2]);
if (action == NULL) {
ZVAL_NULL(params[2]);
} else {
- ZVAL_STRING(params[2], action, 0);
+ ZVAL_STRING(params[2], action, 1);
}
- INIT_ZVAL(param3);
- params[3] = &param3;
+ ALLOC_INIT_ZVAL(params[3]);
ZVAL_LONG(params[3], version);
- INIT_ZVAL(param4);
- params[4] = &param4;
+ ALLOC_INIT_ZVAL(params[4]);
ZVAL_LONG(params[4], one_way);
if (call_user_function(NULL, &this_ptr, &func, response, 5, params TSRMLS_CC) != SUCCESS) {
@@ -2603,6 +2598,11 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
Z_LVAL_PP(trace) > 0) {
add_property_stringl(this_ptr, "__last_response", Z_STRVAL_P(response), Z_STRLEN_P(response), 1);
}
+ zval_ptr_dtor(&params[4]);
+ zval_ptr_dtor(&params[3]);
+ zval_ptr_dtor(&params[2]);
+ zval_ptr_dtor(&params[1]);
+ zval_ptr_dtor(&params[0]);
xmlFree(buf);
if (ret && zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) {
return FALSE;
@@ -2694,124 +2694,134 @@ static void do_soap_call(zval* this_ptr,
SOAP_GLOBAL(features) = 0;
}
- if (sdl != NULL) {
- fn = get_function(sdl, function);
- if (fn != NULL) {
- sdlBindingPtr binding = fn->binding;
- int one_way = 0;
-
- if (fn->responseName == NULL &&
- fn->responseParameters == NULL &&
- soap_headers == NULL) {
- one_way = 1;
- }
-
- if (location == NULL) {
- location = binding->location;
- }
- if (binding->bindingType == BINDING_SOAP) {
- sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
- request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
- ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response TSRMLS_CC);
- } else {
- request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
- ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response TSRMLS_CC);
- }
-
- xmlFreeDoc(request);
-
- if (ret && Z_TYPE(response) == IS_STRING) {
- encode_reset_ns();
- ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers TSRMLS_CC);
- encode_finish();
- }
+ zend_try {
+ if (sdl != NULL) {
+ fn = get_function(sdl, function);
+ if (fn != NULL) {
+ sdlBindingPtr binding = fn->binding;
+ int one_way = 0;
+
+ if (fn->responseName == NULL &&
+ fn->responseParameters == NULL &&
+ soap_headers == NULL) {
+ one_way = 1;
+ }
- zval_dtor(&response);
+ if (location == NULL) {
+ location = binding->location;
+ }
+ if (binding->bindingType == BINDING_SOAP) {
+ sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
+ request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
+ ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response TSRMLS_CC);
+ } else {
+ request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
+ ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response TSRMLS_CC);
+ }
+
+ xmlFreeDoc(request);
+
+ if (ret && Z_TYPE(response) == IS_STRING) {
+ encode_reset_ns();
+ ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers TSRMLS_CC);
+ encode_finish();
+ }
- } else {
- smart_str error = {0};
- smart_str_appends(&error,"Function (\"");
- smart_str_appends(&error,function);
- smart_str_appends(&error,"\") is not a valid method for this service");
- smart_str_0(&error);
- add_soap_fault(this_ptr, "Client", error.c, NULL, NULL TSRMLS_CC);
- smart_str_free(&error);
- }
- } else {
- zval **uri;
- smart_str action = {0};
+ zval_dtor(&response);
- if (zend_hash_find(Z_OBJPROP_P(this_ptr), "uri", sizeof("uri"), (void *)&uri) == FAILURE) {
- add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL TSRMLS_CC);
- } else if (location == NULL) {
- add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL TSRMLS_CC);
- } else {
- if (call_uri == NULL) {
- call_uri = Z_STRVAL_PP(uri);
+ } else {
+ smart_str error = {0};
+ smart_str_appends(&error,"Function (\"");
+ smart_str_appends(&error,function);
+ smart_str_appends(&error,"\") is not a valid method for this service");
+ smart_str_0(&error);
+ add_soap_fault(this_ptr, "Client", error.c, NULL, NULL TSRMLS_CC);
+ smart_str_free(&error);
}
- request = serialize_function_call(this_ptr, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
+ } else {
+ zval **uri;
+ smart_str action = {0};
- if (soap_action == NULL) {
- smart_str_appends(&action, call_uri);
- smart_str_appendc(&action, '#');
- smart_str_appends(&action, function);
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "uri", sizeof("uri"), (void *)&uri) == FAILURE) {
+ add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL TSRMLS_CC);
+ } else if (location == NULL) {
+ add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL TSRMLS_CC);
} else {
- smart_str_appends(&action, soap_action);
- }
- smart_str_0(&action);
+ if (call_uri == NULL) {
+ call_uri = Z_STRVAL_PP(uri);
+ }
+ request = serialize_function_call(this_ptr, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
- ret = do_request(this_ptr, request, location, action.c, soap_version, 0, &response TSRMLS_CC);
+ if (soap_action == NULL) {
+ smart_str_appends(&action, call_uri);
+ smart_str_appendc(&action, '#');
+ smart_str_appends(&action, function);
+ } else {
+ smart_str_appends(&action, soap_action);
+ }
+ smart_str_0(&action);
- smart_str_free(&action);
- xmlFreeDoc(request);
+ ret = do_request(this_ptr, request, location, action.c, soap_version, 0, &response TSRMLS_CC);
- if (ret && Z_TYPE(response) == IS_STRING) {
- encode_reset_ns();
- ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers TSRMLS_CC);
- encode_finish();
- }
+ smart_str_free(&action);
+ xmlFreeDoc(request);
- zval_dtor(&response);
- }
- }
+ if (ret && Z_TYPE(response) == IS_STRING) {
+ encode_reset_ns();
+ ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers TSRMLS_CC);
+ encode_finish();
+ }
- if (!ret) {
- zval** fault;
- if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) {
- *return_value = **fault;
- zval_copy_ctor(return_value);
+ zval_dtor(&response);
+ }
+ }
+
+ if (!ret) {
+ zval** fault;
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) {
+ *return_value = **fault;
+ zval_copy_ctor(return_value);
+ } else {
+ *return_value = *add_soap_fault(this_ptr, "Client", "Unknown Error", NULL, NULL TSRMLS_CC);
+ zval_copy_ctor(return_value);
+ }
} else {
- *return_value = *add_soap_fault(this_ptr, "Client", "Unknown Error", NULL, NULL TSRMLS_CC);
- zval_copy_ctor(return_value);
- }
- } else {
- zval** fault;
- if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) {
- *return_value = **fault;
- zval_copy_ctor(return_value);
+ zval** fault;
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == SUCCESS) {
+ *return_value = **fault;
+ zval_copy_ctor(return_value);
+ }
}
- }
- if (!EG(exception) &&
- Z_TYPE_P(return_value) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry TSRMLS_CC) &&
- (zend_hash_find(Z_OBJPROP_P(this_ptr), "_exceptions", sizeof("_exceptions"), (void **) &tmp) != SUCCESS ||
- Z_TYPE_PP(tmp) != IS_BOOL || Z_LVAL_PP(tmp) != 0)) {
- zval *exception;
+ if (!EG(exception) &&
+ Z_TYPE_P(return_value) == IS_OBJECT &&
+ instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry TSRMLS_CC) &&
+ (zend_hash_find(Z_OBJPROP_P(this_ptr), "_exceptions", sizeof("_exceptions"), (void **) &tmp) != SUCCESS ||
+ Z_TYPE_PP(tmp) != IS_BOOL || Z_LVAL_PP(tmp) != 0)) {
+ zval *exception;
- MAKE_STD_ZVAL(exception);
- MAKE_COPY_ZVAL(&return_value, exception);
- zend_throw_exception_object(exception TSRMLS_CC);
- }
+ MAKE_STD_ZVAL(exception);
+ MAKE_COPY_ZVAL(&return_value, exception);
+ zend_throw_exception_object(exception TSRMLS_CC);
+ }
+ } zend_catch {
+ _bailout = 1;
+ } zend_end_try();
+
if (SOAP_GLOBAL(encoding) != NULL) {
xmlCharEncCloseFunc(SOAP_GLOBAL(encoding));
}
+
SOAP_GLOBAL(features) = old_features;
SOAP_GLOBAL(typemap) = old_typemap;
SOAP_GLOBAL(class_map) = old_class_map;
SOAP_GLOBAL(encoding) = old_encoding;
SOAP_GLOBAL(sdl) = old_sdl;
+ if (_bailout) {
+ _bailout = 0;
+ zend_bailout();
+ }
SOAP_CLIENT_END_CODE();
}
diff --git a/ext/soap/tests/bugs/bug66112.phpt b/ext/soap/tests/bugs/bug66112.phpt
new file mode 100644
index 000000000..4d5be7929
--- /dev/null
+++ b/ext/soap/tests/bugs/bug66112.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #66112 (Use after free condition in SOAP extension)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+define('WSDL', dirname(__FILE__)."/bug66112.wsdl");
+function Mist($p) {
+ $client=new soapclient(WSDL, array('typemap'=>array(array("type_ns"=>"uri:mist", "type_name"=>"A"))));
+ try{
+ $client->Mist(array("XX"=>"xx"));
+ }catch(SoapFault $x){
+ }
+ return array("A"=>"ABC","B"=>"sss");
+}
+$s = new SoapServer(WSDL, array('typemap'=>array(array("type_ns"=>"uri:mist", "type_name"=>"A"))));
+$s->addFunction("Mist");
+$_SERVER["REQUEST_METHOD"] = "POST";
+$HTTP_RAW_POST_DATA=<<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uri="uri:mist">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <uri:Request><uri:A>XXX</uri:A><uri:B>yyy</uri:B></uri:Request>
+ </soapenv:Body>
+</soapenv:Envelope>
+EOF;
+$s->handle($HTTP_RAW_POST_DATA);
+echo "OK\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="uri:mist"><SOAP-ENV:Body><ns1:Response><A>ABC</A><B>sss</B></ns1:Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+OK
diff --git a/ext/soap/tests/bugs/bug66112.wsdl b/ext/soap/tests/bugs/bug66112.wsdl
new file mode 100644
index 000000000..8589a46bf
--- /dev/null
+++ b/ext/soap/tests/bugs/bug66112.wsdl
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:tns="uri:mist" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="test" targetNamespace="uri:mist">
+ <wsdl:types>
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="uri:mist">
+ <xs:complexType name="T1">
+ <xs:sequence>
+ <xs:element name="A" type="xsd:string"/><xs:element name="B" type="xsd:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="Request" type="tns:T1"/><xs:element name="Response" type="tns:T1"/>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="Request">
+ <wsdl:part name="Request" element="tns:Request"/>
+ </wsdl:message>
+ <wsdl:message name="Response">
+ <wsdl:part name="Response" element="tns:Response"/>
+ </wsdl:message>
+ <wsdl:portType name="test">
+ <wsdl:operation name="Mist">
+ <wsdl:input message="tns:Request"/>
+ <wsdl:output message="tns:Response"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="test" type="tns:test">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="Mist">
+ <soap:operation soapAction="Mist"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="test">
+ <wsdl:port name="test" binding="tns:test">
+ <soap:address location="http://127.0.0.1:81/mist.php"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4
index 9c7524964..a5a63dfb6 100644
--- a/ext/sockets/config.m4
+++ b/ext/sockets/config.m4
@@ -16,10 +16,10 @@ if test "$PHP_SOCKETS" != "no"; then
if test "$ac_cv_cmsghdr" = yes; then
AC_DEFINE(HAVE_CMSGHDR,1,[Whether you have struct cmsghdr])
- fi
+ fi
AC_CHECK_FUNCS([hstrerror socketpair if_nametoindex if_indextoname])
- AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h sys/sockio.h errno.h])
+ AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h sys/sockio.h errno.h])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
@@ -27,7 +27,7 @@ if test "$PHP_SOCKETS" != "no"; then
[AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])]
)
AC_DEFINE([HAVE_SOCKETS], 1, [ ])
-
+
dnl Check for fied ss_family in sockaddr_storage (missing in AIX until 5.3)
AC_CACHE_CHECK([for field ss_family in struct sockaddr_storage], ac_cv_ss_family,
[
@@ -38,11 +38,24 @@ if test "$PHP_SOCKETS" != "no"; then
], [struct sockaddr_storage sa_store; sa_store.ss_family = AF_INET6;],
ac_cv_ss_family=yes, ac_cv_ss_family=no)
])
-
+
if test "$ac_cv_ss_family" = yes; then
AC_DEFINE(HAVE_SA_SS_FAMILY,1,[Whether you have sockaddr_storage.ss_family])
fi
+ dnl Check for AI_V4MAPPED flag
+ AC_CACHE_CHECK([if getaddrinfo supports AI_V4MAPPED],[ac_cv_gai_ai_v4mapped],
+ [
+ AC_TRY_COMPILE([
+#include <netdb.h>
+ ], [int flag = AI_V4MAPPED;],
+ ac_cv_gai_ai_v4mapped=yes, ac_cv_gai_ai_v4mapped=no)
+ ])
+
+ if test "$ac_cv_gai_ai_v4mapped" = yes; then
+ AC_DEFINE(HAVE_AI_V4MAPPED,1,[Whether you have AI_V4MAPPED])
+ fi
+
PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared])
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
fi
diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c
index 64523c319..1c1a90d58 100644
--- a/ext/sockets/sockaddr_conv.c
+++ b/ext/sockets/sockaddr_conv.c
@@ -9,6 +9,8 @@
#include <arpa/inet.h>
#endif
+extern int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC);
+
#if HAVE_IPV6
/* Sets addr by hostname, or by ip in string form (AF_INET6) */
int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */
@@ -27,7 +29,11 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_INET6;
+#if HAVE_AI_V4MAPPED
hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
+#else
+ hints.ai_flags = AI_ADDRCONFIG;
+#endif
getaddrinfo(string, NULL, &hints, &addrinfo);
if (!addrinfo) {
#ifdef PHP_WIN32
diff --git a/ext/spl/tests/class_implements_variation.phpt b/ext/spl/tests/class_implements_variation.phpt
index 52fdbcaf7..84a52ab2d 100644
--- a/ext/spl/tests/class_implements_variation.phpt
+++ b/ext/spl/tests/class_implements_variation.phpt
@@ -16,8 +16,8 @@ var_dump(class_implements(new fs));
var_dump(class_implements('fs'));
echo "\n--- testing autoload ---\n";
-var_dump(class_implements('non-existent'));
-var_dump(class_implements('non-existent2', false));
+var_dump(class_implements('non_existent'));
+var_dump(class_implements('non_existent2', false));
function __autoload($classname) {
@@ -35,11 +35,11 @@ array(0) {
}
--- testing autoload ---
-attempting to autoload non-existent
+attempting to autoload non_existent
-Warning: class_implements(): Class non-existent does not exist and could not be loaded in %s on line %d
+Warning: class_implements(): Class non_existent does not exist and could not be loaded in %s on line %d
bool(false)
-Warning: class_implements(): Class non-existent2 does not exist in %s on line %d
+Warning: class_implements(): Class non_existent2 does not exist in %s on line %d
bool(false)
===DONE===
diff --git a/ext/spl/tests/class_uses_variation.phpt b/ext/spl/tests/class_uses_variation.phpt
index 9c21521c6..1a13521ea 100644
--- a/ext/spl/tests/class_uses_variation.phpt
+++ b/ext/spl/tests/class_uses_variation.phpt
@@ -16,8 +16,8 @@ var_dump(class_uses(new fs));
var_dump(class_uses('fs'));
echo "\n--- testing autoload ---\n";
-var_dump(class_uses('non-existent'));
-var_dump(class_uses('non-existent2', false));
+var_dump(class_uses('non_existent'));
+var_dump(class_uses('non_existent2', false));
function __autoload($classname) {
@@ -35,11 +35,11 @@ array(0) {
}
--- testing autoload ---
-attempting to autoload non-existent
+attempting to autoload non_existent
-Warning: class_uses(): Class non-existent does not exist and could not be loaded in %s on line %d
+Warning: class_uses(): Class non_existent does not exist and could not be loaded in %s on line %d
bool(false)
-Warning: class_uses(): Class non-existent2 does not exist in %s on line %d
+Warning: class_uses(): Class non_existent2 does not exist in %s on line %d
bool(false)
===DONE===
diff --git a/ext/standard/tests/array/each.phpt b/ext/standard/tests/array/each.phpt
index 19ee728fd..974808c08 100644
--- a/ext/standard/tests/array/each.phpt
+++ b/ext/standard/tests/array/each.phpt
Binary files differ
diff --git a/ext/standard/tests/class_object/class_exists_variation_001.phpt b/ext/standard/tests/class_object/class_exists_variation_001.phpt
index 52a358476..5f51b4bd9 100644
--- a/ext/standard/tests/class_object/class_exists_variation_001.phpt
+++ b/ext/standard/tests/class_object/class_exists_variation_001.phpt
@@ -100,15 +100,12 @@ In __autoload(12345)
bool(false)
Arg value -2345
-In __autoload(-2345)
bool(false)
Arg value 10.5
-In __autoload(10.5)
bool(false)
Arg value -10.5
-In __autoload(-10.5)
bool(false)
Arg value 101234567000
@@ -116,11 +113,9 @@ In __autoload(101234567000)
bool(false)
Arg value 1.07654321E-9
-In __autoload(1.07654321E-9)
bool(false)
Arg value 0.5
-In __autoload(0.5)
bool(false)
Error: 8 - Array to string conversion, %sclass_exists_variation_001.php(%d)
diff --git a/ext/standard/tests/class_object/trait_exists_variation_001.phpt b/ext/standard/tests/class_object/trait_exists_variation_001.phpt
index e7fa4afd1..81df711cf 100644
--- a/ext/standard/tests/class_object/trait_exists_variation_001.phpt
+++ b/ext/standard/tests/class_object/trait_exists_variation_001.phpt
@@ -100,15 +100,12 @@ In __autoload(12345)
bool(false)
Arg value -2345
-In __autoload(-2345)
bool(false)
Arg value 10.5
-In __autoload(10.5)
bool(false)
Arg value -10.5
-In __autoload(-10.5)
bool(false)
Arg value 101234567000
@@ -116,11 +113,9 @@ In __autoload(101234567000)
bool(false)
Arg value 1.07654321E-9
-In __autoload(1.07654321E-9)
bool(false)
Arg value 0.5
-In __autoload(0.5)
bool(false)
Error: 8 - Array to string conversion, %strait_exists_variation_001.php(%d)
diff --git a/ext/standard/tests/file/007_error.phpt b/ext/standard/tests/file/007_error.phpt
index a369c9d97..112beb305 100644
--- a/ext/standard/tests/file/007_error.phpt
+++ b/ext/standard/tests/file/007_error.phpt
@@ -76,7 +76,7 @@ bool(false)
Warning: fopen() expects at least 2 parameters, 0 given in %s on line %d
bool(false)
-Warning: fclose(): 5 is not a valid stream resource in %s on line %d
+Warning: fclose(): %d is not a valid stream resource in %s on line %d
bool(false)
Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d
@@ -85,7 +85,7 @@ bool(false)
Warning: fclose() expects exactly 1 parameter, 0 given in %s on line %d
bool(false)
-Warning: feof(): 5 is not a valid stream resource in %s on line %d
+Warning: feof(): %d is not a valid stream resource in %s on line %d
bool(false)
Warning: feof() expects parameter 1 to be resource, string given in %s on line %d
diff --git a/ext/standard/tests/file/fgetss_error.phpt b/ext/standard/tests/file/fgetss_error.phpt
index 3691e962e..2b4ad6812 100644
--- a/ext/standard/tests/file/fgetss_error.phpt
+++ b/ext/standard/tests/file/fgetss_error.phpt
@@ -98,7 +98,7 @@ bool(false)
Warning: fgetss() expects parameter 1 to be resource, object given in %s on line %d
bool(false)
-- Testing fgetss() with closed/unset file handle --
-Warning: fgetss(): 5 is not a valid stream resource in %s on line %d
+Warning: fgetss(): %d is not a valid stream resource in %s on line %d
bool(false)
Warning: fgetss() expects parameter 1 to be resource, null given in %s on line %d
diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt
index a28095bc2..254ad7688 100644
--- a/ext/standard/tests/file/ftruncate_error.phpt
+++ b/ext/standard/tests/file/ftruncate_error.phpt
@@ -114,7 +114,7 @@ Warning: ftruncate() expects parameter 1 to be resource, object given in %s on l
bool(false)
-- Testing ftruncate() with closed/unset file handle --
-Warning: ftruncate(): 5 is not a valid stream resource in %s on line %d
+Warning: ftruncate(): %d is not a valid stream resource in %s on line %d
bool(false)
int(36)
diff --git a/ext/standard/tests/general_functions/floatval.phpt b/ext/standard/tests/general_functions/floatval.phpt
index b427bda7d..9b7a3281e 100644
--- a/ext/standard/tests/general_functions/floatval.phpt
+++ b/ext/standard/tests/general_functions/floatval.phpt
@@ -157,8 +157,8 @@ float(-5000000)
*** Testing floatval() on non floating types ***
float(-2147483648)
float(2147483648)
-float(5)
-float(6)
+float(%d)
+float(%d)
float(0)
float(1)
float(-1300)
@@ -175,8 +175,8 @@ float(0)
*** Testing doubleval() on non floating types ***
float(-2147483648)
float(2147483648)
-float(5)
-float(6)
+float(%d)
+float(%d)
float(0)
float(1)
float(-1300)
diff --git a/ext/standard/tests/general_functions/gettype_settype_basic.phpt b/ext/standard/tests/general_functions/gettype_settype_basic.phpt
index d6fb0d495..d1fd4095b 100644
--- a/ext/standard/tests/general_functions/gettype_settype_basic.phpt
+++ b/ext/standard/tests/general_functions/gettype_settype_basic.phpt
@@ -232,11 +232,11 @@ int(0)
string(7) "integer"
-- Iteration 12 --
bool(true)
-int(5)
+int(%d)
string(7) "integer"
-- Iteration 13 --
bool(true)
-int(6)
+int(%d)
string(7) "integer"
-- Iteration 14 --
8: Object of class point could not be converted to int
@@ -291,11 +291,11 @@ int(0)
string(7) "integer"
-- Iteration 12 --
bool(true)
-int(5)
+int(%d)
string(7) "integer"
-- Iteration 13 --
bool(true)
-int(6)
+int(%d)
string(7) "integer"
-- Iteration 14 --
8: Object of class point could not be converted to int
@@ -350,11 +350,11 @@ float(0)
string(6) "double"
-- Iteration 12 --
bool(true)
-float(5)
+float(%d)
string(6) "double"
-- Iteration 13 --
bool(true)
-float(6)
+float(%d)
string(6) "double"
-- Iteration 14 --
8: Object of class point could not be converted to double
@@ -409,11 +409,11 @@ float(0)
string(6) "double"
-- Iteration 12 --
bool(true)
-float(5)
+float(%d)
string(6) "double"
-- Iteration 13 --
bool(true)
-float(6)
+float(%d)
string(6) "double"
-- Iteration 14 --
8: Object of class point could not be converted to double
@@ -610,12 +610,12 @@ string(6) "string"
-- Iteration 12 --
2: settype(): Cannot convert to resource type
bool(false)
-resource(5) of type (stream)
+resource(%d) of type (stream)
string(8) "resource"
-- Iteration 13 --
2: settype(): Cannot convert to resource type
bool(false)
-resource(6) of type (stream)
+resource(%d) of type (stream)
string(8) "resource"
-- Iteration 14 --
2: settype(): Cannot convert to resource type
@@ -716,14 +716,14 @@ string(5) "array"
bool(true)
array(1) {
[0]=>
- resource(5) of type (stream)
+ resource(%d) of type (stream)
}
string(5) "array"
-- Iteration 13 --
bool(true)
array(1) {
[0]=>
- resource(6) of type (stream)
+ resource(%d) of type (stream)
}
string(5) "array"
-- Iteration 14 --
@@ -824,14 +824,14 @@ string(6) "object"
bool(true)
object(stdClass)#2 (1) {
["scalar"]=>
- resource(5) of type (stream)
+ resource(%d) of type (stream)
}
string(6) "object"
-- Iteration 13 --
bool(true)
object(stdClass)#2 (1) {
["scalar"]=>
- resource(6) of type (stream)
+ resource(%d) of type (stream)
}
string(6) "object"
-- Iteration 14 --
@@ -893,11 +893,11 @@ string(6) "string"
string(6) "string"
-- Iteration 12 --
bool(true)
-string(14) "Resource id #5"
+string(14) "Resource id #%d"
string(6) "string"
-- Iteration 13 --
bool(true)
-string(14) "Resource id #6"
+string(14) "Resource id #%d"
string(6) "string"
-- Iteration 14 --
bool(true)
diff --git a/ext/standard/tests/general_functions/print_r.phpt b/ext/standard/tests/general_functions/print_r.phpt
index 81a523ad0..19e71fbfd 100644
--- a/ext/standard/tests/general_functions/print_r.phpt
+++ b/ext/standard/tests/general_functions/print_r.phpt
@@ -1484,13 +1484,13 @@ object_class Object
*** Testing print_r() on resources ***
-- Iteration 1 --
-Resource id #5
-Resource id #5
-Resource id #5
+Resource id #%d
+Resource id #%d
+Resource id #%d
-- Iteration 2 --
-Resource id #6
-Resource id #6
-Resource id #6
+Resource id #%d
+Resource id #%d
+Resource id #%d
*** Testing print_r() on different combinations of scalar
and non-scalar variables ***
diff --git a/ext/standard/tests/general_functions/strval.phpt b/ext/standard/tests/general_functions/strval.phpt
index b92be41ef..372ac6701 100644
--- a/ext/standard/tests/general_functions/strval.phpt
+++ b/ext/standard/tests/general_functions/strval.phpt
@@ -279,9 +279,9 @@ string(0) ""
-- Iteration 1 --
string(6) "Object"
-- Iteration 2 --
-string(14) "Resource id #5"
+string(14) "Resource id #%d"
-- Iteration 3 --
-string(14) "Resource id #6"
+string(14) "Resource id #%d"
-- Iteration 4 --
Notice: Array to string conversion in %sstrval.php on line %d
diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt
index 98eccbbda..51654b185 100644
--- a/ext/standard/tests/general_functions/type.phpt
+++ b/ext/standard/tests/general_functions/type.phpt
@@ -105,9 +105,9 @@ int(0)
bool(true)
int(0)
bool(true)
-int(5)
+int(%d)
bool(true)
-int(6)
+int(%d)
string(54) "Object of class stdClass could not be converted to int"
bool(true)
int(%d)
@@ -128,9 +128,9 @@ float(0)
bool(true)
float(0)
bool(true)
-float(5)
+float(%d)
bool(true)
-float(6)
+float(%d)
string(57) "Object of class stdClass could not be converted to double"
bool(true)
float(%d)
diff --git a/ext/standard/tests/general_functions/var_dump.phpt b/ext/standard/tests/general_functions/var_dump.phpt
index 09e9f3b99..c47227141 100644
--- a/ext/standard/tests/general_functions/var_dump.phpt
+++ b/ext/standard/tests/general_functions/var_dump.phpt
@@ -844,9 +844,9 @@ object(object_class)#13 (8) {
*** Testing var_dump() on resources ***
-- Iteration 1 --
-resource(5) of type (stream)
+resource(%d) of type (stream)
-- Iteration 2 --
-resource(6) of type (stream)
+resource(%d) of type (stream)
*** Testing var_dump() on different combinations of scalar
and non-scalar variables ***
@@ -1227,9 +1227,9 @@ array(4) {
}
array(2) {
[0]=>
- resource(5) of type (stream)
+ resource(%d) of type (stream)
[1]=>
- resource(6) of type (stream)
+ resource(%d) of type (stream)
}
array(9) {
[0]=>
diff --git a/ext/standard/tests/mail/bug51604.phpt b/ext/standard/tests/mail/bug51604.phpt
index a65702102..988849c4e 100644
--- a/ext/standard/tests/mail/bug51604.phpt
+++ b/ext/standard/tests/mail/bug51604.phpt
@@ -11,7 +11,7 @@ if(substr(PHP_OS, 0, 3) == "WIN")
--FILE--
<?php
// Initialise all required variables
-$to = 'user@company.com';
+$to = 'user@example.com';
$subject = 'Test Subject';
$message = 'A Message';
$additional_headers = "KHeaders\n\n\n\n\n";
@@ -27,7 +27,7 @@ unlink($outFile);
===DONE===
--EXPECT--
bool(true)
-To: user@company.com
+To: user@example.com
Subject: Test Subject
KHeaders
diff --git a/ext/standard/tests/mail/mail_basic.phpt b/ext/standard/tests/mail/mail_basic.phpt
index fecb50f32..70f32df40 100644
--- a/ext/standard/tests/mail/mail_basic.phpt
+++ b/ext/standard/tests/mail/mail_basic.phpt
@@ -20,7 +20,7 @@ echo "*** Testing mail() : basic functionality ***\n";
// Initialise all required variables
-$to = 'user@company.com';
+$to = 'user@example.com';
$subject = 'Test Subject';
$message = 'A Message';
$additional_headers = 'KHeaders';
@@ -45,7 +45,7 @@ unlink($outFile);
*** Testing mail() : basic functionality ***
-- All Mail Content Parameters --
bool(true)
-To: user@company.com
+To: user@example.com
Subject: Test Subject
KHeaders
@@ -53,7 +53,7 @@ A Message
-- Mandatory Parameters --
bool(true)
-To: user@company.com
+To: user@example.com
Subject: Test Subject
A Message
diff --git a/ext/standard/tests/mail/mail_basic2.phpt b/ext/standard/tests/mail/mail_basic2.phpt
index 8967d18c4..60ad00919 100644
--- a/ext/standard/tests/mail/mail_basic2.phpt
+++ b/ext/standard/tests/mail/mail_basic2.phpt
@@ -20,7 +20,7 @@ echo "*** Testing mail() : basic functionality ***\n";
// Initialise all required variables
-$to = 'user@company.com';
+$to = 'user@example.com';
$subject = 'Test Subject';
$message = 'A Message';
$additional_headers = 'KHeaders';
@@ -40,7 +40,7 @@ unlink($outFile);
*** Testing mail() : basic functionality ***
-- extra parameters --
bool(true)
-%w1%wTo: user@company.com
+%w1%wTo: user@example.com
%w2%wSubject: Test Subject
%w3%wKHeaders
%w4%w
diff --git a/ext/standard/tests/mail/mail_basic3.phpt b/ext/standard/tests/mail/mail_basic3.phpt
index 58eae0379..3e648e5ca 100644
--- a/ext/standard/tests/mail/mail_basic3.phpt
+++ b/ext/standard/tests/mail/mail_basic3.phpt
@@ -19,7 +19,7 @@ echo "*** Testing mail() : basic functionality ***\n";
// Initialise all required variables
-$to = 'user@company.com';
+$to = 'user@example.com';
$subject = 'Test Subject';
$message = 'A Message';
diff --git a/ext/standard/tests/mail/mail_basic4.phpt b/ext/standard/tests/mail/mail_basic4.phpt
index 9ecc886ae..de2407a74 100644
--- a/ext/standard/tests/mail/mail_basic4.phpt
+++ b/ext/standard/tests/mail/mail_basic4.phpt
@@ -19,7 +19,7 @@ echo "*** Testing mail() : basic functionality ***\n";
// Initialise all required variables
-$to = 'user@company.com';
+$to = 'user@example.com';
$subject = 'Test Subject';
$message = 'A Message';
diff --git a/ext/standard/tests/mail/mail_basic5.phpt b/ext/standard/tests/mail/mail_basic5.phpt
index 7e42ccb83..8d755ebb8 100644
--- a/ext/standard/tests/mail/mail_basic5.phpt
+++ b/ext/standard/tests/mail/mail_basic5.phpt
@@ -19,7 +19,7 @@ echo "*** Testing mail() : basic functionality ***\n";
// Initialise all required variables
-$to = 'user@company.com';
+$to = 'user@example.com';
$subject = 'Test Subject';
$message = 'A Message';
diff --git a/ext/standard/tests/mail/mail_basic_alt1-win32.phpt b/ext/standard/tests/mail/mail_basic_alt1-win32.phpt
index 3c4dd88a5..fc5049834 100644
--- a/ext/standard/tests/mail/mail_basic_alt1-win32.phpt
+++ b/ext/standard/tests/mail/mail_basic_alt1-win32.phpt
@@ -22,7 +22,7 @@ max_execution_time = 120
error_reporting(E_ALL & ~E_STRICT);
ini_set("SMTP", "localhost");
ini_set("smtp_port", 25);
-ini_set("sendmail_from", "user@company.com");
+ini_set("sendmail_from", "user@example.com");
echo "*** Testing mail() : basic functionality ***\n";
require_once(dirname(__FILE__).'/mail_include.inc');
diff --git a/ext/standard/tests/mail/mail_basic_alt2-win32.phpt b/ext/standard/tests/mail/mail_basic_alt2-win32.phpt
index d7bae62a0..892d92391 100644
--- a/ext/standard/tests/mail/mail_basic_alt2-win32.phpt
+++ b/ext/standard/tests/mail/mail_basic_alt2-win32.phpt
@@ -32,7 +32,7 @@ bool mail ( string \$to , string \$subject , string \$message [, string \$additi
Send an email message
HERE;
-$extra_headers = "from: user@company.com";
+$extra_headers = "from: user@example.com";
$res = mail($to, $subject, $message, $extra_headers);
diff --git a/ext/standard/tests/mail/mail_basic_alt3-win32.phpt b/ext/standard/tests/mail/mail_basic_alt3-win32.phpt
index 86b57eb81..1caa68c06 100644
--- a/ext/standard/tests/mail/mail_basic_alt3-win32.phpt
+++ b/ext/standard/tests/mail/mail_basic_alt3-win32.phpt
@@ -32,7 +32,7 @@ bool mail ( string \$to , string \$subject , string \$message [, string \$additi
Send an email message
HERE;
-$extra_headers = "FRom: user@company.com";
+$extra_headers = "FRom: user@example.com";
$res = mail($to, $subject, $message, $extra_headers);
diff --git a/ext/standard/tests/mail/mail_basic_alt4-win32.phpt b/ext/standard/tests/mail/mail_basic_alt4-win32.phpt
index f4a9d466b..c8e45242e 100644
--- a/ext/standard/tests/mail/mail_basic_alt4-win32.phpt
+++ b/ext/standard/tests/mail/mail_basic_alt4-win32.phpt
@@ -32,7 +32,7 @@ bool mail ( string \$to , string \$subject , string \$message [, string \$additi
Send an email message
HERE;
-$extra_headers = "from: user@company.com";
+$extra_headers = "from: user@example.com";
$extra_parameters = "addons"; // should be ignored
$res = mail($to, $subject, $message, $extra_headers, $extra_parameters);
diff --git a/ext/standard/tests/mail/mail_variation1.phpt b/ext/standard/tests/mail/mail_variation1.phpt
index bf37bf41e..a8eb6bec7 100644
--- a/ext/standard/tests/mail/mail_variation1.phpt
+++ b/ext/standard/tests/mail/mail_variation1.phpt
@@ -18,7 +18,7 @@ if(substr(PHP_OS, 0, 3) == "WIN")
echo "*** Testing mail() : variation ***\n";
// Initialise all required variables
-$to = 'user@company.com';
+$to = 'user@example.com';
$subject = 'Test Subject';
$message = 'A Message';
var_dump( mail($to, $subject, $message) );
diff --git a/ext/standard/tests/mail/mail_variation2.phpt b/ext/standard/tests/mail/mail_variation2.phpt
index c16c2706a..f0e44241b 100644
--- a/ext/standard/tests/mail/mail_variation2.phpt
+++ b/ext/standard/tests/mail/mail_variation2.phpt
@@ -21,7 +21,7 @@ echo "*** Testing mail() : basic functionality ***\n";
// Initialise all required variables
-$to = 'user@company.com';
+$to = 'user@example.com';
$subject = 'Test Subject';
$message = 'A Message';
$outFile = "/tmp/php_test_mailVariation2.out";
@@ -36,7 +36,7 @@ unlink($outFile);
--EXPECTF--
*** Testing mail() : basic functionality ***
bool(true)
-%w1%wTo: user@company.com
+%w1%wTo: user@example.com
%w2%wSubject: Test Subject
%w3%w
%w4%wA Message
diff --git a/ext/standard/tests/mail/mail_variation_alt1-win32.phpt b/ext/standard/tests/mail/mail_variation_alt1-win32.phpt
index b81f3af9d..dd7fd937e 100644
--- a/ext/standard/tests/mail/mail_variation_alt1-win32.phpt
+++ b/ext/standard/tests/mail/mail_variation_alt1-win32.phpt
@@ -21,7 +21,7 @@ max_execution_time = 120
error_reporting(E_ALL & ~E_STRICT);
ini_set("SMTP", "localhost");
ini_set("smtp_port", 2525);
-ini_set("sendmail_from", "user@company.com");
+ini_set("sendmail_from", "user@example.com");
echo "*** Testing mail() : basic functionality ***\n";
require_once(dirname(__FILE__).'/mail_include.inc');
diff --git a/ext/standard/tests/mail/mail_variation_alt2-win32.phpt b/ext/standard/tests/mail/mail_variation_alt2-win32.phpt
index 6ae06bb20..817cc36af 100644
--- a/ext/standard/tests/mail/mail_variation_alt2-win32.phpt
+++ b/ext/standard/tests/mail/mail_variation_alt2-win32.phpt
@@ -21,7 +21,7 @@ max_execution_time = 120
error_reporting(E_ALL & ~E_STRICT);
ini_set("SMTP", "localplace");
ini_set("smtp_port", 25);
-ini_set("sendmail_from", "user@company.com");
+ini_set("sendmail_from", "user@example.com");
echo "*** Testing mail() : basic functionality ***\n";
require_once(dirname(__FILE__).'/mail_include.inc');
diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt
index 3997c54b5..3720c0692 100644
--- a/ext/standard/tests/strings/implode1.phpt
+++ b/ext/standard/tests/strings/implode1.phpt
Binary files differ
diff --git a/ext/xsl/tests/bug49634.phpt b/ext/xsl/tests/bug49634.phpt
new file mode 100644
index 000000000..b009fd5fb
--- /dev/null
+++ b/ext/xsl/tests/bug49634.phpt
@@ -0,0 +1,105 @@
+--TEST--
+bug #49634 (Segfault throwing an exception in a XSL registered function)
+--SKIPIF--
+<?php
+extension_loaded("xsl") or die("skip need ext/xsl");
+?>
+--FILE--
+<?php
+
+$sXml = <<<XML
+<?xml version="1.0" encoding="UTF-8" ?>
+<root>
+ test
+</root>
+XML;
+
+$cDIR = __DIR__;
+$sXsl = <<<XSL
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:ext="http://php.net/xsl"
+ xsl:extension-element-prefixes="ext"
+ exclude-result-prefixes="ext">
+ <xsl:output encoding="UTF-8" indent="yes" method="xml" />
+ <xsl:template match="/">
+ <xsl:value-of select="ext:function('testFunction', document('$cDIR/bug49634.xml')/root)"/>
+ </xsl:template>
+</xsl:stylesheet>
+XSL;
+
+function testFunction($a)
+{
+ throw new Exception('Test exception.');
+}
+
+$domXml = new DOMDocument;
+$domXml->loadXML($sXml);
+$domXsl = new DOMDocument;
+$domXsl->loadXML($sXsl);
+
+for ($i = 0; $i < 10; $i++)
+{
+ $xsltProcessor = new XSLTProcessor();
+ $xsltProcessor->registerPHPFunctions(array('testFunction'));
+ $xsltProcessor->importStyleSheet($domXsl);
+ try {
+ @$xsltProcessor->transformToDoc($domXml);
+ } catch (Exception $e) {
+ echo $e,"\n";
+ }
+}
+?>
+===DONE===
+--EXPECTF--
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+exception 'Exception' with message 'Test exception.' in %s:%d
+Stack trace:
+#0 [internal function]: testFunction(Array)
+#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument))
+#2 {main}
+===DONE===
diff --git a/ext/xsl/tests/bug49634.xml b/ext/xsl/tests/bug49634.xml
new file mode 100644
index 000000000..f3f286eaf
--- /dev/null
+++ b/ext/xsl/tests/bug49634.xml
@@ -0,0 +1 @@
+<root/>
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index af11104a2..f5acc14bb 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -279,7 +279,10 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
node->type = XML_NAMESPACE_DECL;
node->parent = nsparent;
node->ns = curns;
+ } else {
+ node = xmlDocCopyNodeList(domintern->document->ptr, node);
}
+
child = php_dom_create_object(node, &ret, child, domintern TSRMLS_CC);
add_next_index_zval(args[i], child);
}
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index d3ec27baf..805fc1eba 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1537,7 +1537,7 @@ static ZIPARCHIVE_METHOD(open)
RETURN_LONG((long)err);
}
ze_obj->filename = estrdup(resolved_path);
- ze_obj->filename_len = filename_len;
+ ze_obj->filename_len = strlen(resolved_path);
ze_obj->za = intern;
RETURN_TRUE;
}