mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-13 12:10:50 +00:00
Compare commits
465
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de528a07da | ||
|
|
6e284c6ce7 | ||
|
|
f2b8b4879d | ||
|
|
aa480a4f4f | ||
|
|
d3d7da14e6 | ||
|
|
12954aa27d | ||
|
|
e0cc7032f1 | ||
|
|
6051aa795c | ||
|
|
d090061f5e | ||
|
|
db472c60cf | ||
|
|
cc93e8e51f | ||
|
|
beea66d595 | ||
|
|
cea8df3af5 | ||
|
|
de90c602e1 | ||
|
|
9fd373d8b6 | ||
|
|
4ef26e2379 | ||
|
|
56d6f23196 | ||
|
|
6ddfa33aad | ||
|
|
8f54a74d60 | ||
|
|
e34dc6c6f7 | ||
|
|
1488704098 | ||
|
|
d091516c31 | ||
|
|
409022b742 | ||
|
|
0630945ac4 | ||
|
|
79aa564f8d | ||
|
|
929e0f185c | ||
|
|
a60513240f | ||
|
|
6290b8814c | ||
|
|
f6c2511748 | ||
|
|
fa161f96fa | ||
|
|
baf2e822cc | ||
|
|
e2e96913bf | ||
|
|
92d68c62af | ||
|
|
19b6735d86 | ||
|
|
cbd4f7602e | ||
|
|
6c0c4896b3 | ||
|
|
08a499f142 | ||
|
|
44e2c266c3 | ||
|
|
42f3972e61 | ||
|
|
34f08a3715 | ||
|
|
04b575f409 | ||
|
|
f4f7a32121 | ||
|
|
159635f4f5 | ||
|
|
37c18f5ebe | ||
|
|
2449c41698 | ||
|
|
bcf8485ef5 | ||
|
|
57ec3758b7 | ||
|
|
b2110c3eea | ||
|
|
4c2e6c1cf6 | ||
|
|
bfd10cfee9 | ||
|
|
029d7f4c6c | ||
|
|
757a32cd0c | ||
|
|
f2bc53b88b | ||
|
|
b61c50a004 | ||
|
|
636c61c1d5 | ||
|
|
14e1bc89bc | ||
|
|
997f323e3a | ||
|
|
13eb47a8bc | ||
|
|
edfa1988fc | ||
|
|
741f41ff18 | ||
|
|
2b6a290d55 | ||
|
|
ae1baaa592 | ||
|
|
0c2bbe47b2 | ||
|
|
8a929d8942 | ||
|
|
32319a142f | ||
|
|
8b27b6d559 | ||
|
|
bb78412b07 | ||
|
|
395ebb5c8b | ||
|
|
4a7bf95c90 | ||
|
|
66bba32627 | ||
|
|
0ea2ef125b | ||
|
|
b0e5d35202 | ||
|
|
44add6d195 | ||
|
|
6e246ad0d5 | ||
|
|
caf6a6dc7a | ||
|
|
673fe19b39 | ||
|
|
363b56f261 | ||
|
|
5b0373b060 | ||
|
|
d69796f23f | ||
|
|
a3796f27fb | ||
|
|
c8a621b191 | ||
|
|
b3ccd26eb4 | ||
|
|
d3fd31b6dd | ||
|
|
7ec6d3ae47 | ||
|
|
a20deb1607 | ||
|
|
8535adfb31 | ||
|
|
42c4b86c88 | ||
|
|
0e3ec21e6f | ||
|
|
94ccf70c77 | ||
|
|
cf8bf9f2f0 | ||
|
|
e2ad8e9c1c | ||
|
|
823de19461 | ||
|
|
61b2568310 | ||
|
|
ac9708ccf2 | ||
|
|
987db5f747 | ||
|
|
2df7afeb1c | ||
|
|
fc83d523b8 | ||
|
|
99049e2fdd | ||
|
|
a10e7fe11d | ||
|
|
23e438594d | ||
|
|
054e1cafa0 | ||
|
|
04c2df66a3 | ||
|
|
fcb9e4b2b3 | ||
|
|
3c63a836cf | ||
|
|
22710d1c44 | ||
|
|
83b69f4034 | ||
|
|
5dc5c26a5f | ||
|
|
7acdad749c | ||
|
|
74d6fe4f00 | ||
|
|
292abd1240 | ||
|
|
d31c5e8a4d | ||
|
|
946456425e | ||
|
|
c3c761ffeb | ||
|
|
23e564762a | ||
|
|
e825d1b579 | ||
|
|
8280b0a710 | ||
|
|
627540cc0b | ||
|
|
8d1012b2c3 | ||
|
|
1d3696eecb | ||
|
|
577d81faa2 | ||
|
|
9c2b6c7b58 | ||
|
|
0b9be2918d | ||
|
|
329449f799 | ||
|
|
894cfb078b | ||
|
|
b892d762e5 | ||
|
|
6672b31c45 | ||
|
|
cafb45221f | ||
|
|
3be1f24fba | ||
|
|
b8251d54a8 | ||
|
|
1ee8ff3b7d | ||
|
|
992d32c6a7 | ||
|
|
ac1ae51a38 | ||
|
|
7d1eef4aa7 | ||
|
|
5d5951f247 | ||
|
|
8ec6ada087 | ||
|
|
ae40e5f400 | ||
|
|
7b68c1e634 | ||
|
|
1cf3ec5eab | ||
|
|
774e127a00 | ||
|
|
43edfb2710 | ||
|
|
c4b7abb4ea | ||
|
|
987c843674 | ||
|
|
d5899d0b33 | ||
|
|
efcfbc953e | ||
|
|
c4d83a413c | ||
|
|
5bd0be8a15 | ||
|
|
46ac1e373a | ||
|
|
5c2477a0d8 | ||
|
|
8237737bd9 | ||
|
|
4eb7fc8aa6 | ||
|
|
293f710827 | ||
|
|
7fb6b5ca98 | ||
|
|
37dab6afee | ||
|
|
74b693f16b | ||
|
|
6d64b2a4c9 | ||
|
|
217382d4ef | ||
|
|
5f75a28d01 | ||
|
|
8f80896718 | ||
|
|
05763e18bb | ||
|
|
3dafd9549d | ||
|
|
85bf6f0329 | ||
|
|
aa2ec7517e | ||
|
|
819be8a3b2 | ||
|
|
1b416caeb1 | ||
|
|
0c2ee427d7 | ||
|
|
e788932a91 | ||
|
|
cf6b208cab | ||
|
|
93fcf04fc1 | ||
|
|
c9a0fbe122 | ||
|
|
c1d43480cc | ||
|
|
92ef080a2e | ||
|
|
f5b05ce162 | ||
|
|
0d7226ed60 | ||
|
|
778edca904 | ||
|
|
f8e21c395b | ||
|
|
d70a9f988d | ||
|
|
10c20ceaf4 | ||
|
|
6c07bc8004 | ||
|
|
08ddf683fc | ||
|
|
71a5c3d7ec | ||
|
|
bbe8518456 | ||
|
|
12081f5659 | ||
|
|
113e304dcf | ||
|
|
d10755c0e6 | ||
|
|
955b801fea | ||
|
|
887f30dc61 | ||
|
|
8d6e997315 | ||
|
|
0806f78f77 | ||
|
|
f4554096e1 | ||
|
|
3964ddd1c4 | ||
|
|
e3da6ac3da | ||
|
|
6481440f3f | ||
|
|
23a5f873fb | ||
|
|
6e1f77ef6b | ||
|
|
606d61bd1c | ||
|
|
2b309c8f9e | ||
|
|
22be55e6da | ||
|
|
370d483bcb | ||
|
|
249667f9e3 | ||
|
|
fd0009d8d6 | ||
|
|
cff7a300d1 | ||
|
|
52cc62d825 | ||
|
|
21abc2f1c1 | ||
|
|
4b9857e7a4 | ||
|
|
f7ee12e928 | ||
|
|
ccae79a2c3 | ||
|
|
262492a187 | ||
|
|
06d5c9a8f0 | ||
|
|
0ff4d7d811 | ||
|
|
23c4c46b36 | ||
|
|
b498b5dfe5 | ||
|
|
ba3498ea33 | ||
|
|
c2ca352598 | ||
|
|
d42a0aee91 | ||
|
|
e854b05aea | ||
|
|
6210bf0dba | ||
|
|
209bfe82e5 | ||
|
|
9d80c25005 | ||
|
|
1a615eeaa2 | ||
|
|
75fa63b57f | ||
|
|
bb16e23891 | ||
|
|
0ec1758381 | ||
|
|
86ed2eeb5d | ||
|
|
a54847a0fb | ||
|
|
6a504c6f6b | ||
|
|
55aab4e6de | ||
|
|
9b1ba00a1e | ||
|
|
c92904d160 | ||
|
|
a76f790b58 | ||
|
|
17af8b0179 | ||
|
|
c776180f6e | ||
|
|
0e37aa144f | ||
|
|
c7a8bd6a4c | ||
|
|
f4009b52a3 | ||
|
|
bc0d535f5a | ||
|
|
60857e013b | ||
|
|
ae2e75a657 | ||
|
|
21fb2a42cc | ||
|
|
3b37e152c3 | ||
|
|
25adf56921 | ||
|
|
cca899148a | ||
|
|
0bcbaa1750 | ||
|
|
9277da7d9d | ||
|
|
cd7681d273 | ||
|
|
031085e0a9 | ||
|
|
f75714650b | ||
|
|
14ed144318 | ||
|
|
baf834a00a | ||
|
|
68ff1463e7 | ||
|
|
d846d0e80a | ||
|
|
10da251565 | ||
|
|
f472141549 | ||
|
|
0afd4bd18b | ||
|
|
087a134b50 | ||
|
|
00a6dd29b7 | ||
|
|
14e7d404d9 | ||
|
|
a62829c09e | ||
|
|
479a47d8af | ||
|
|
7af15a41d9 | ||
|
|
47315dfdf6 | ||
|
|
f7cdabd118 | ||
|
|
e6c9a31c54 | ||
|
|
83d01bd81b | ||
|
|
f4f2aa7583 | ||
|
|
cb7f656de7 | ||
|
|
b903587268 | ||
|
|
b97e76d512 | ||
|
|
e69b73e0b8 | ||
|
|
e2ac61225f | ||
|
|
c989a36927 | ||
|
|
3d7a201eb4 | ||
|
|
e91cecb1d3 | ||
|
|
b7eefa0af7 | ||
|
|
a65eba016e | ||
|
|
3b030ec75f | ||
|
|
07bcf1080d | ||
|
|
69a12bfb3f | ||
|
|
ef74038d1d | ||
|
|
6ff2f7040e | ||
|
|
490b75d170 | ||
|
|
8267eaf1bf | ||
|
|
885357a711 | ||
|
|
983cedfd94 | ||
|
|
4bf9334a82 | ||
|
|
35c42425fa | ||
|
|
e2caad5f96 | ||
|
|
6814cbec4b | ||
|
|
bed49c931d | ||
|
|
e38369c532 | ||
|
|
5cf61f4d8b | ||
|
|
86eae702f2 | ||
|
|
0d8e83532a | ||
|
|
ee920e12ec | ||
|
|
e9f4cfd6af | ||
|
|
00169ec00f | ||
|
|
508f926604 | ||
|
|
ba8ce4a6d4 | ||
|
|
f7e6e6cedf | ||
|
|
6f3c7a8b70 | ||
|
|
00842d6996 | ||
|
|
e40c470c9d | ||
|
|
221a07b669 | ||
|
|
8e314ae7fc | ||
|
|
edcc7dce4e | ||
|
|
8f71a6f673 | ||
|
|
9aa379c724 | ||
|
|
2ee837aa5e | ||
|
|
a417820be3 | ||
|
|
1eb7704974 | ||
|
|
2ea7c05d75 | ||
|
|
85de397a23 | ||
|
|
66d5eb12a9 | ||
|
|
f551ed4189 | ||
|
|
23cab07e4f | ||
|
|
36fde4043b | ||
|
|
a944f7a663 | ||
|
|
c61d125986 | ||
|
|
38c1181cfa | ||
|
|
2957b7cbb6 | ||
|
|
e9efaea7c4 | ||
|
|
2f5dc540e0 | ||
|
|
76425aaca1 | ||
|
|
c4e6beebb3 | ||
|
|
9ea582a76c | ||
|
|
df2ca16fa8 | ||
|
|
3e17b49008 | ||
|
|
9e5bc2c138 | ||
|
|
d257aa42ff | ||
|
|
78a15091f9 | ||
|
|
24be7e2106 | ||
|
|
2ce1fd71ea | ||
|
|
4ab19212e5 | ||
|
|
d91d06af30 | ||
|
|
6613fefb80 | ||
|
|
74b8f72017 | ||
|
|
27fc1b889a | ||
|
|
66ce68e7a4 | ||
|
|
df0ce635e4 | ||
|
|
a0857d56ac | ||
|
|
2954832b97 | ||
|
|
c2a245f582 | ||
|
|
5dcdf5c467 | ||
|
|
cab76530e7 | ||
|
|
a7dbf5a29e | ||
|
|
229bdc7ccb | ||
|
|
20f4ea9de8 | ||
|
|
6242101f2b | ||
|
|
4a8eeb7afb | ||
|
|
8f77168384 | ||
|
|
cde80bd812 | ||
|
|
c11e307ae0 | ||
|
|
9bf9b88f20 | ||
|
|
3e46e95ac1 | ||
|
|
8f8a54ab37 | ||
|
|
176c6fe901 | ||
|
|
0bce4957e5 | ||
|
|
278392a10b | ||
|
|
5bac59b7d1 | ||
|
|
93ce043480 | ||
|
|
f3cd7fdda4 | ||
|
|
a2e0e2564d | ||
|
|
02302812e1 | ||
|
|
6df67ace20 | ||
|
|
7a80c3a0ed | ||
|
|
3841295b2a | ||
|
|
fc7ee596f6 | ||
|
|
6c564a7802 | ||
|
|
a44515caf9 | ||
|
|
3d347be242 | ||
|
|
8192ba2b60 | ||
|
|
1a4897c88e | ||
|
|
2d0ab7c98b | ||
|
|
cd4928c99a | ||
|
|
e510daf20b | ||
|
|
be3d70df4e | ||
|
|
be24877c84 | ||
|
|
e575557612 | ||
|
|
21f71027e3 | ||
|
|
e85c367bc7 | ||
|
|
1153eaf505 | ||
|
|
c157f4b4e6 | ||
|
|
1dd5690af2 | ||
|
|
5ca8ba7ab6 | ||
|
|
a0d805035c | ||
|
|
339f46237d | ||
|
|
1b6dd18082 | ||
|
|
92e5b10c41 | ||
|
|
833ec62d7c | ||
|
|
782c00d744 | ||
|
|
2e206e0761 | ||
|
|
0e80f26207 | ||
|
|
047ed8dfbb | ||
|
|
f2cfb997de | ||
|
|
def1ab1e60 | ||
|
|
3e36ecd98f | ||
|
|
03b6daed4f | ||
|
|
840308cfd0 | ||
|
|
f9721d03f7 | ||
|
|
cd2cdd256a | ||
|
|
2975308e1a | ||
|
|
e8486cc374 | ||
|
|
47012ccd8f | ||
|
|
4919f3286b | ||
|
|
2c76af8538 | ||
|
|
689268a0ba | ||
|
|
88c1755a14 | ||
|
|
dd5781bcdf | ||
|
|
ef777fc18e | ||
|
|
1dbfe6e310 | ||
|
|
3c6104e180 | ||
|
|
f335f27b7b | ||
|
|
4551bd57f7 | ||
|
|
4ad6108b7d | ||
|
|
9aec0c6806 | ||
|
|
4929964a5d | ||
|
|
018013e579 | ||
|
|
8b33e6fae0 | ||
|
|
a270348c24 | ||
|
|
f2ce3e0201 | ||
|
|
0ab7f1cebf | ||
|
|
8ca08487b7 | ||
|
|
3c364cbe52 | ||
|
|
13a91f86b7 | ||
|
|
8307f9e892 | ||
|
|
5b85234b37 | ||
|
|
660aa6701d | ||
|
|
0dd448cbf1 | ||
|
|
5572becc81 | ||
|
|
3595f09c28 | ||
|
|
081b001ca1 | ||
|
|
9484248c0a | ||
|
|
c5c87c5f37 | ||
|
|
334d2df892 | ||
|
|
68811c473d | ||
|
|
95a3bfb1bc | ||
|
|
f06e3ba5c1 | ||
|
|
8a48311a60 | ||
|
|
ab7992fab2 | ||
|
|
5b55a18622 | ||
|
|
5a53a74304 | ||
|
|
be87834321 | ||
|
|
8bbd451647 | ||
|
|
d37dea8b7b | ||
|
|
1e86e8e12c | ||
|
|
07aa25b442 | ||
|
|
2b8d0edb45 | ||
|
|
5fb54640c9 | ||
|
|
56cdee2def | ||
|
|
27e640fdea | ||
|
|
f5687db392 | ||
|
|
6f15da050e | ||
|
|
6e35b40b4c | ||
|
|
0778bedbe1 | ||
|
|
e90ac23f58 | ||
|
|
b78ac8df82 | ||
|
|
d7b8f23e2b | ||
|
|
50b56c2c0f | ||
|
|
6da18ca967 | ||
|
|
8d816ed0ef | ||
|
|
e68e2893c0 | ||
|
|
ee832705d1 | ||
|
|
7e34334d84 | ||
|
|
94b3d60a4f | ||
|
|
dd68a6239a | ||
|
|
39d814a205 |
No files matched your search
@@ -1,36 +1,283 @@
|
||||
PHP NEWS
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
10 Mar 2011, PHP 5.3.6RC3
|
||||
- Shmop extension:
|
||||
. Fixed bug #54193 (Integer overflow in shmop_read()). (Felipe)
|
||||
Reported by Jose Carlos Norte <jose at eyeos dot org> (CVE-2011-1092)
|
||||
18 Aug 2011, PHP 5.3.7
|
||||
- Upgraded bundled SQLite to version 3.7.7.1. (Scott)
|
||||
- Upgraded bundled PCRE to version 8.12. (Scott)
|
||||
|
||||
- SPL extension:
|
||||
. Fixed bug #49608 (Using CachingIterator on DirectoryIterator instance
|
||||
segfaults). (Felipe)
|
||||
|
||||
03 Mar 2011, PHP 5.3.6RC2
|
||||
- Zend Engine:
|
||||
. Fixed bug #43512 (same parameter name can be used multiple times in
|
||||
method/function definition). (Felipe)
|
||||
. Fixed bug #55156 (ReflectionClass::getDocComment() returns comment even
|
||||
though the class has none). (Felipe)
|
||||
. Fixed bug #55007 (compiler fail after previous fail). (Felipe)
|
||||
. Fixed bug #54910 (Crash when calling call_user_func with unknown function
|
||||
name). (Dmitry)
|
||||
. Fixed bug #54804 (__halt_compiler and imported namespaces).
|
||||
(Pierrick, Felipe)
|
||||
. Fixed bug #54624 (class_alias and type hint). (Felipe)
|
||||
. Fixed bug #54585 (track_errors causes segfault). (Dmitry)
|
||||
. Fixed bug #54423 (classes from dl()'ed extensions are not destroyed).
|
||||
(Tony, Dmitry)
|
||||
. Fixed bug #54372 (Crash accessing global object itself returned from its
|
||||
__get() handle). (Dmitry)
|
||||
. Fixed bug #54367 (Use of closure causes problem in ArrayAccess). (Dmitry)
|
||||
. Fixed bug #54358 (Closure, use and reference). (Dmitry)
|
||||
. Fixed bug #54262 (Crash when assigning value to a dimension in a non-array).
|
||||
(Dmitry)
|
||||
. Fixed bug #54039 (use() of static variables in lambda functions can break
|
||||
staticness). (Dmitry)
|
||||
|
||||
- Exif extension:
|
||||
. Fixed bug #54002 (crash on crafted tag, reported by Luca Carettoni).
|
||||
(Pierre) (CVE-2011-0708)
|
||||
- Core
|
||||
. Updated crypt_blowfish to 1.2. ((CVE-2011-2483) (Solar Designer)
|
||||
. Removed warning when argument of is_a() or is_subclass_of() is not
|
||||
a known class. (Stas)
|
||||
. Fixed crash in error_log(). (Felipe) Reported by Mateusz Kocielski.
|
||||
. Added PHP_MANDIR constant telling where the manpages were installed into,
|
||||
and an --man-dir argument to php-config. (Hannes)
|
||||
. Fixed a crash inside dtor for error handling. (Ilia)
|
||||
. Fixed buffer overflow on overlog salt in crypt(). (Clément LECIGNE, Stas)
|
||||
. Implemented FR #54459 (Range function accuracy). (Adam)
|
||||
|
||||
. Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path).
|
||||
(Ilia)
|
||||
. Fixed bug #55339 (Segfault with allow_call_time_pass_reference = Off).
|
||||
(Dmitry)
|
||||
. Fixed bug #55295 [NEW]: popen_ex on windows, fixed possible heap overflow
|
||||
(Pierre)
|
||||
. Fixed bug #55258 (Windows Version Detecting Error).
|
||||
( xiaomao5 at live dot com, Pierre)
|
||||
. Fixed bug #55187 (readlink returns weird characters when false result).
|
||||
(Pierre)
|
||||
. Fixed bug #55082 (var_export() doesn't escape properties properly).
|
||||
(Gustavo)
|
||||
. Fixed bug #55014 (Compile failure due to improper use of ctime_r()). (Ilia)
|
||||
. Fixed bug #54939 (File path injection vulnerability in RFC1867 File upload
|
||||
filename). (Felipe) Reported by Krzysztof Kotowicz. (CVE-2011-2202)
|
||||
. Fixed bug #54935 php_win_err can lead to crash. (Pierre)
|
||||
. Fixed bug #54924 (assert.* is not being reset upon request shutdown). (Ilia)
|
||||
. Fixed bug #54895 (Fix compiling with older gcc version without need for
|
||||
membar_producer macro). (mhei at heimpold dot de)
|
||||
. Fixed bug #54866 (incorrect accounting for realpath_cache_size).
|
||||
(Dustin Ward)
|
||||
. Fixed bug #54723 (getimagesize() doesn't check the full ico signature).
|
||||
(Scott)
|
||||
. Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt
|
||||
size). (Pierre, os at irj dot ru)
|
||||
. Fixed bug #54580 (get_browser() segmentation fault when browscap ini
|
||||
directive is set through php_admin_value). (Gustavo)
|
||||
. Fixed bug #54332 (Crash in zend_mm_check_ptr // Heap corruption). (Dmitry)
|
||||
. Fixed bug #54305 (Crash in gc_remove_zval_from_buffer). (Dmitry)
|
||||
. Fixed bug #54238 (use-after-free in substr_replace()). (Stas)
|
||||
(CVE-2011-1148)
|
||||
. Fixed bug #54204 (Can't set a value with a PATH section in php.ini).
|
||||
(Pierre)
|
||||
. Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment).
|
||||
(tomas dot brastavicius at quantum dot lt, Pierrick)
|
||||
. Fixed bug #54137 (file_get_contents POST request sends additional line
|
||||
break). (maurice-php at mertinkat dot net, Ilia)
|
||||
. Fixed bug #53848 (fgetcsv() ignores spaces at beginnings of fields). (Ilia)
|
||||
. Alternative fix for bug #52550, as applied to the round() function (signed
|
||||
overflow), as the old fix impacted the algorithm for numbers with magnitude
|
||||
smaller than 0. (Gustavo)
|
||||
. Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
|
||||
(Ralph Schindler, Dmitry)
|
||||
. Fixed bug #52935 (call exit in user_error_handler cause stream relate
|
||||
core). (Gustavo)
|
||||
. Fixed bug #51997 (SEEK_CUR with 0 value, returns a warning). (Ilia)
|
||||
. Fixed bug #50816 (Using class constants in array definition fails).
|
||||
(Pierrick, Dmitry)
|
||||
. Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode
|
||||
filter). (slusarz at curecanti dot org)
|
||||
. Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using
|
||||
TMPDIR on Windows). (Pierre)
|
||||
|
||||
- Apache2 Handler SAPI:
|
||||
. Fixed bug #54529 (SAPI crashes on apache_config.c:197).
|
||||
(hebergement at riastudio dot fr)
|
||||
|
||||
- CLI SAPI:
|
||||
. Fixed bug #52496 (Zero exit code on option parsing failure). (Ilia)
|
||||
|
||||
- cURL extension:
|
||||
. Added ini option curl.cainfo (support for custom cert db). (Pierre)
|
||||
. Added CURLINFO_REDIRECT_URL support. (Daniel Stenberg, Pierre)
|
||||
. Added support for CURLOPT_MAX_RECV_SPEED_LARGE and
|
||||
CURLOPT_MAX_SEND_SPEED_LARGE. FR #51815. (Pierrick)
|
||||
|
||||
- DateTime extension:
|
||||
. Fixed bug where the DateTime object got changed while using date_diff().
|
||||
(Derick)
|
||||
. Fixed bug #54340 (DateTime::add() method bug). (Adam)
|
||||
. Fixed bug #54316 (DateTime::createFromFormat does not handle trailing '|'
|
||||
correctly). (Adam)
|
||||
. Fixed bug #54283 (new DatePeriod(NULL) causes crash). (Felipe)
|
||||
. Fixed bug #51819 (Case discrepancy in timezone names cause Uncaught
|
||||
exception and fatal error). (Hannes)
|
||||
|
||||
- DBA extension:
|
||||
. Supress warning on non-existent file open with Berkeley DB 5.2 (Chris Jones)
|
||||
. Fixed bug #54242 (dba_insert returns true if key already exists). (Felipe)
|
||||
|
||||
- Exif extesion:
|
||||
. Fixed bug #54121 (error message format string typo). (Ilia)
|
||||
|
||||
- Fileinfo extension:
|
||||
. Fixed bug #54934 (Unresolved symbol strtoull in HP-UX 11.11). (Felipe)
|
||||
|
||||
- Filter extension:
|
||||
. Added 3rd parameter to filter_var_array() and filter_input_array()
|
||||
functions that allows disabling addition of empty elements. (Ilia)
|
||||
. Fixed bug #53037 (FILTER_FLAG_EMPTY_STRING_NULL is not implemented). (Ilia)
|
||||
|
||||
- Interbase extension:
|
||||
. Fixed bug #54269 (Short exception message buffer causes crash). (Felipe)
|
||||
|
||||
- intl extension:
|
||||
. Implemented FR #54561 (Expose ICU version info). (David Zuelke, Ilia)
|
||||
. Implemented FR #54540 (Allow loading of arbitrary resource bundles when
|
||||
fallback is disabled). (David Zuelke, Stas)
|
||||
|
||||
- Imap extension:
|
||||
. Fixed bug #55313 (Number of retries not set when params specified).
|
||||
(kevin at kevinlocke dot name)
|
||||
|
||||
- json extension:
|
||||
. Fixed bug #54484 (Empty string in json_decode doesn't reset
|
||||
json_last_error()). (Ilia)
|
||||
|
||||
- LDAP extension:
|
||||
. Fixed bug #53339 (Fails to build when compilng with gcc 4.5 and DSO
|
||||
libraries). (Clint Byrum, Raphael)
|
||||
|
||||
- libxml extension:
|
||||
. Fixed bug #54601 (Removing the doctype node segfaults). (Hannes)
|
||||
. Fixed bug #54440 (libxml extension ignores default context). (Gustavo)
|
||||
|
||||
- mbstring extension:
|
||||
. Fixed bug #54494 (mb_substr() mishandles UTF-32LE and UCS-2LE). (Gustavo)
|
||||
|
||||
- MCrypt extension:
|
||||
. Change E_ERROR to E_WARNING in mcrypt_create_iv when not enough data
|
||||
has been fetched (Windows). (Pierre)
|
||||
. Fixed bug #55169 (mcrypt_create_iv always fails to gather sufficient random
|
||||
data on Windows). (Pierre)
|
||||
|
||||
- MySQL Improved extension:
|
||||
. Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi queries).
|
||||
(Andrey)
|
||||
|
||||
- mysqlnd
|
||||
. Fixed crash when using more than 28,000 bound parameters. Workaround is to
|
||||
set mysqlnd.net_cmd_buffer_size to at least 9000. (Andrey)
|
||||
. Fixed bug #54674 mysqlnd valid_sjis_(head|tail) is using invalid operator
|
||||
and range). (nihen at megabbs dot com, Andrey)
|
||||
|
||||
- MySQLi extension:
|
||||
. Fixed bug #55283 (SSL options set by mysqli_ssl_set ignored for MySQLi
|
||||
persistent connections). (Andrey)
|
||||
|
||||
- OpenSSL extension:
|
||||
. Fixed bug #54060 (Memory leaks when openssl_encrypt). (Pierre)
|
||||
. Fixed bug #54061 (Memory leaks when openssl_decrypt). (Pierre)
|
||||
. openssl_encrypt()/openssl_decrypt() truncated keys of variable length
|
||||
ciphers to the OpenSSL default for the algorithm. (Scott)
|
||||
. On blocking SSL sockets respect the timeout option where possible.
|
||||
(Scott)
|
||||
. Fixed bug #54992 (Stream not closed and error not returned when SSL
|
||||
CN_match fails). (Gustavo, laird_ngrps at dodo dot com dot au)
|
||||
|
||||
- Oracle Database extension (OCI8):
|
||||
. Added oci_client_version() returning the runtime Oracle client library
|
||||
version (Chris Jones)
|
||||
|
||||
. PCRE extension:
|
||||
. Increased the backtrack limit from 100000 to 1000000 (Rasmus)
|
||||
|
||||
- PDO extension:
|
||||
. Fixed bug #54929 (Parse error with single quote in sql comment). (Felipe)
|
||||
. Fixed bug #52104 (bindColumn creates Warning regardless of ATTR_ERRMODE
|
||||
settings). (Ilia)
|
||||
|
||||
- PDO DBlib driver:
|
||||
. Fixed bug #54329 (MSSql extension memory leak).
|
||||
(dotslashpok at gmail dot com)
|
||||
. Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field).
|
||||
(mjh at hodginsmedia dot com, Felipe)
|
||||
|
||||
- PDO ODBC driver:
|
||||
. Fixed data type usage in 64bit. (leocsilva at gmail dot com)
|
||||
|
||||
- PDO MySQL driver:
|
||||
. Fixed bug #54644 (wrong pathes in php_pdo_mysql_int.h). (Tony, Johannes)
|
||||
. Fixed bug #53782 (foreach throws irrelevant exception). (Johannes, Andrey)
|
||||
. Implemented FR #48587 (MySQL PDO driver doesn't support SSL connections).
|
||||
(Rob)
|
||||
|
||||
- PDO PostgreSQL driver:
|
||||
. Fixed bug #54318 (Non-portable grep option used in PDO pgsql
|
||||
configuration). (bwalton at artsci dot utoronto dot ca)
|
||||
|
||||
- PDO Oracle driver:
|
||||
. Fixed bug #44989 (64bit Oracle RPMs still not supported by pdo-oci).
|
||||
(jbnance at tresgeek dot net)
|
||||
|
||||
- Phar extension:
|
||||
. Fixed bug #54395 (Phar::mount() crashes when calling with wrong parameters).
|
||||
(Felipe)
|
||||
|
||||
- PHP-FPM SAPI:
|
||||
. Implemented FR #54499 (FPM ping and status_path should handle HEAD request). (fat)
|
||||
. Implemented FR #54172 (Overriding the pid file location of php-fpm). (fat)
|
||||
. Fixed missing Expires and Cache-Control headers for ping and status pages.
|
||||
(fat)
|
||||
. Fixed memory leak. (fat) Reported and fixed by Giovanni Giacobbi.
|
||||
. Fixed wrong value of log_level when invoking fpm with -tt. (fat)
|
||||
. Added xml format to the status page. (fat)
|
||||
. Removed timestamp in logs written by children processes. (fat)
|
||||
. Fixed exit at FPM startup on fpm_resources_prepare() errors. (fat)
|
||||
. Added master rlimit_files and rlimit_core in the global configuration
|
||||
settings. (fat)
|
||||
. Removed pid in debug logs written by chrildren processes. (fat)
|
||||
. Added custom access log (also added per request %CPU and memory
|
||||
mesurement). (fat)
|
||||
. Added a real scoreboard and several improvements to the status page. (fat)
|
||||
|
||||
- Reflection extension:
|
||||
. Fixed bug #54347 (reflection_extension does not lowercase module function
|
||||
name). (Felipe, laruence at yahoo dot com dot cn)
|
||||
|
||||
- SOAP extension:
|
||||
. Fixed bug #55323 (SoapClient segmentation fault when XSD_TYPEKIND_EXTENSION
|
||||
contains itself). (Dmitry)
|
||||
. Fixed bug #54312 (soap_version logic bug). (tom at samplonius dot org)
|
||||
|
||||
- Sockets extension:
|
||||
. Fixed stack buffer overflow in socket_connect(). (CVE-2011-1938)
|
||||
Found by Mateusz Kocielski, Marek Kroemeke and Filip Palian. (Felipe)
|
||||
. Changed socket_set_block() and socket_set_nonblock() so they emit warnings
|
||||
on error. (Gustavo)
|
||||
. Fixed bug #51958 (socket_accept() fails on IPv6 server sockets). (Gustavo)
|
||||
|
||||
- SPL extension:
|
||||
. Fixed memory leak in DirectoryIterator::getExtension() and
|
||||
SplFileInfo::getExtension(). (Felipe)
|
||||
. Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys
|
||||
on true). (Pierrick)
|
||||
. Fixed bug #54970 (SplFixedArray::setSize() isn't resizing). (Felipe)
|
||||
. Fixed bug #54609 (Certain implementation(s) of SplFixedArray cause hard
|
||||
crash). (Felipe)
|
||||
. Fixed bug #54384 (Dual iterators, GlobIterator, SplFileObject and
|
||||
SplTempFileObject crash when user-space classes don't call the paren
|
||||
constructor). (Gustavo)
|
||||
. Fixed bug #54292 (Wrong parameter causes crash in
|
||||
SplFileObject::__construct()). (Felipe)
|
||||
. Fixed bug #54291 (Crash iterating DirectoryIterator for dir name starting
|
||||
with \0). (Gustavo)
|
||||
. Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator).
|
||||
(Felipe)
|
||||
|
||||
- Tokenizer Extension
|
||||
. Fixed bug #54089 (token_get_all() does not stop after __halt_compiler).
|
||||
(Ilia)
|
||||
- Streams:
|
||||
. Fixed bug #54946 (stream_get_contents infinite loop). (Hannes)
|
||||
. Fixed bug #54623 (Segfault when writing to a persistent socket after
|
||||
closing a copy of the socket). (Gustavo)
|
||||
. Fixed bug #54681 (addGlob() crashes on invalid flags). (Felipe)
|
||||
|
||||
17 Feb 2011, PHP 5.3.6RC1
|
||||
|
||||
17 Mar 2011, PHP 5.3.6
|
||||
- Upgraded bundled Sqlite3 to version 3.7.4. (Ilia)
|
||||
- Upgraded bundled PCRE to version 8.11. (Ilia)
|
||||
|
||||
@@ -38,6 +285,8 @@
|
||||
. Indirect reference to $this fails to resolve if direct $this is never used
|
||||
in method. (Scott)
|
||||
. Added options to debug backtrace functions. (Stas)
|
||||
. Fixed bug numerous crashes due to setlocale (crash on error, pcre, mysql
|
||||
etc.) on Windows in thread safe mode. (Pierre)
|
||||
. Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime
|
||||
error). (Dmitry)
|
||||
. Fixed Bug #53958 (Closures can't 'use' shared variables by value and by
|
||||
@@ -46,6 +295,8 @@
|
||||
. Fixed Bug #51458 (Lack of error context with nested exceptions). (Stas)
|
||||
. Fixed Bug #47143 (Throwing an exception in a destructor causes a fatal
|
||||
error). (Stas)
|
||||
. Fixed bug #43512 (same parameter name can be used multiple times in
|
||||
method/function definition). (Felipe)
|
||||
|
||||
- Core:
|
||||
. Added ability to connect to HTTPS sites through proxy with basic
|
||||
@@ -85,6 +336,10 @@
|
||||
. Fixed bug #52063 (DateTime constructor's second argument doesn't have a
|
||||
null default value). (Gustavo, Stas)
|
||||
|
||||
- Exif extension:
|
||||
. Fixed bug #54002 (crash on crafted tag, reported by Luca Carettoni).
|
||||
(Pierre) (CVE-2011-0708)
|
||||
|
||||
- Filter extension:
|
||||
. Fixed bug #53924 (FILTER_VALIDATE_URL doesn't validate port number).
|
||||
(Ilia, Gustavo)
|
||||
@@ -139,6 +394,8 @@
|
||||
- OpenSSL extension:
|
||||
. Fixed stream_socket_enable_crypto() not honoring the socket timeout in
|
||||
server mode. (Gustavo)
|
||||
. Fixed bug #54060 (Memory leaks when openssl_encrypt). (Pierre)
|
||||
. Fixed bug #54061 (Memory leaks when openssl_decrypt). (Pierre)
|
||||
. Fixed bug #53592 (stream_socket_enable_crypto() busy-waits in client mode).
|
||||
(Gustavo)
|
||||
. Implemented FR #53447 (Cannot disable SessionTicket extension for servers
|
||||
@@ -160,6 +417,8 @@
|
||||
(gyp at balabit dot hu)
|
||||
|
||||
- Phar extension:
|
||||
. Fixed bug #54247 (format-string vulnerability on Phar). (Felipe)
|
||||
(CVE-2011-1153)
|
||||
. Fixed bug #53541 (format string bug in ext/phar).
|
||||
(crrodriguez at opensuse dot org, Ilia)
|
||||
. Fixed bug #53898 (PHAR reports invalid error message, when the directory
|
||||
@@ -180,6 +439,10 @@
|
||||
. Fixed bug #53915 (ReflectionClass::getConstant(s) emits fatal error on
|
||||
constants with self::). (Gustavo)
|
||||
|
||||
- Shmop extension:
|
||||
. Fixed bug #54193 (Integer overflow in shmop_read()). (Felipe)
|
||||
Reported by Jose Carlos Norte <jose at eyeos dot org> (CVE-2011-1092)
|
||||
|
||||
- SNMP extension:
|
||||
. Fixed bug #51336 (snmprealwalk (snmp v1) does not handle end of OID tree
|
||||
correctly). (Boris Lytochkin)
|
||||
@@ -189,9 +452,14 @@
|
||||
(Mateusz Kocielski, Pierre)
|
||||
|
||||
- SPL extension:
|
||||
. Fixed memory leak in DirectoryIterator::getExtension() and
|
||||
SplFileInfo::getExtension(). (Felipe)
|
||||
. Fixed bug #53914 (SPL assumes HAVE_GLOB is defined). (Chris Jones)
|
||||
. Fixed bug #53515 (property_exists incorrect on ArrayObject null and 0
|
||||
values). (Felipe)
|
||||
. Fixed bug #49608 (Using CachingIterator on DirectoryIterator instance
|
||||
segfaults). (Felipe)
|
||||
|
||||
. Added SplFileInfo::getExtension(). FR #48767. (Peter Cowburn)
|
||||
|
||||
- SQLite3 extension:
|
||||
@@ -213,6 +481,10 @@
|
||||
elements of the returned array before converting them). (Gustavo)
|
||||
. Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo)
|
||||
|
||||
- Tokenizer Extension
|
||||
. Fixed bug #54089 (token_get_all() does not stop after __halt_compiler).
|
||||
(Ilia)
|
||||
|
||||
- XSL extension:
|
||||
. Fixed memory leaked introduced by the NULL poisoning patch.
|
||||
(Mateusz Kocielski, Pierre)
|
||||
|
||||
+20
-7
@@ -51,27 +51,40 @@ SUCH DAMAGE.
|
||||
|
||||
6. ext/standard crypt's blowfish implementation
|
||||
|
||||
The crypt_blowfish homepage is:
|
||||
|
||||
http://www.openwall.com/crypt/
|
||||
|
||||
This code comes from John the Ripper password cracker, with reentrant
|
||||
and crypt(3) interfaces added, but optimizations specific to password
|
||||
cracking removed.
|
||||
|
||||
Written by Solar Designer <solar at openwall.com> in 1998-2002 and
|
||||
placed in the public domain.
|
||||
Written by Solar Designer <solar at openwall.com> in 1998-2011.
|
||||
No copyright is claimed, and the software is hereby placed in the public
|
||||
domain. In case this attempt to disclaim copyright and place the software
|
||||
in the public domain is deemed null and void, then the software is
|
||||
Copyright (c) 1998-2011 Solar Designer and it is hereby released to the
|
||||
general public under the following terms:
|
||||
|
||||
There's absolutely no warranty.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted.
|
||||
|
||||
There's ABSOLUTELY NO WARRANTY, express or implied.
|
||||
|
||||
It is my intent that you should be able to use this on your system,
|
||||
as a part of a software package, or anywhere else to improve security,
|
||||
as part of a software package, or anywhere else to improve security,
|
||||
ensure compatibility, or for any other purpose. I would appreciate
|
||||
it if you give credit where it is due and keep your modifications in
|
||||
the public domain as well, but I don't require that in order to let
|
||||
you place this code and any modifications you make under a license
|
||||
of your choice.
|
||||
|
||||
This implementation is compatible with OpenBSD bcrypt.c (version 2a)
|
||||
by Niels Provos <provos at citi.umich.edu>, and uses some of his
|
||||
This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
|
||||
"$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
|
||||
ideas. The password hashing algorithm was designed by David Mazieres
|
||||
<dm at lcs.mit.edu>.
|
||||
<dm at lcs.mit.edu>. For more information on the level of compatibility,
|
||||
please refer to the comments in BF_set_key() and to the crypt(3) man page
|
||||
included in the crypt_blowfish tarball.
|
||||
|
||||
There's a paper on the algorithm that explains its design decisions:
|
||||
|
||||
|
||||
+10
-14
@@ -100,16 +100,14 @@ Derick) run the following commands for you:
|
||||
|
||||
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
|
||||
|
||||
3. Update the MD5 sums in ``web/qa/trunk/include/rc-md5sums.txt`` (no empty lines).
|
||||
3. Update ``web/qa/trunk/include/release-qa.php`` with the appropriate information.
|
||||
See the documentation within release-qa.php for more information, but all releases
|
||||
and RCs are configured here. Only $QA_RELEASES needs to be edited.
|
||||
|
||||
4. Update in ``web/qa/trunk/include/release-qa.php`` constants with the new RC and
|
||||
commit this.
|
||||
Example: When rolling an RC, set the 'rc' with appropriate information for the
|
||||
given version.
|
||||
|
||||
a. ``$BUILD_TEST_RELEASES`` = array("4.4.7RC1", "5.2.2RC1")
|
||||
|
||||
b. ``$CURRENT_QA_RELEASE_4`` = "4.4.7RC1" (``$CURRENT_QA_RELEASE_5`` for PHP5)
|
||||
|
||||
c. ``$RELEASE_PROCESS`` = array(4 => true, 5 => true)
|
||||
Note: Remember to update the MD5 checksum information.
|
||||
|
||||
1. Update in ``php-bugs/trunk/include/functions.inc`` the ``show_version_option``
|
||||
function to include the new RC and commit.
|
||||
@@ -244,13 +242,11 @@ number, and remove the RC from there.
|
||||
|
||||
11. Update ``qaweb/include/release-qa.php``
|
||||
|
||||
a. Update the $BUILD_TEST_RELEASES array with the release name
|
||||
- Update $QA_RELEASES with the appropriate information, which means bumping
|
||||
the version number to an upcoming version.
|
||||
|
||||
b. Update $RELEASE_PROCESS array (set to false)
|
||||
|
||||
I. For PHP4: Set $CURRENT_QA_RELEASE_4 to false
|
||||
|
||||
II. For PHP5: Set $CURRENT_QA_RELEASE_5 to false
|
||||
Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version,
|
||||
so replace 5.3.7 with 5.3.8 within $QA_RELEASES.
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
--------------------------------------
|
||||
|
||||
+17
-2
@@ -629,7 +629,14 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
|
||||
memcmp(path, (*bucket)->path, path_len) == 0) {
|
||||
realpath_cache_bucket *r = *bucket;
|
||||
*bucket = (*bucket)->next;
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
|
||||
/* if the pointers match then only subtract the length of the path */
|
||||
if(r->path == r->realpath) {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
|
||||
} else {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
}
|
||||
|
||||
free(r);
|
||||
return;
|
||||
} else {
|
||||
@@ -704,7 +711,14 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
|
||||
if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) {
|
||||
realpath_cache_bucket *r = *bucket;
|
||||
*bucket = (*bucket)->next;
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
|
||||
/* if the pointers match then only subtract the length of the path */
|
||||
if(r->path == r->realpath) {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
|
||||
} else {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
}
|
||||
|
||||
free(r);
|
||||
} else if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
|
||||
memcmp(path, (*bucket)->path, path_len) == 0) {
|
||||
@@ -1079,6 +1093,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
}
|
||||
if (is_dir && !directory) {
|
||||
/* not a directory */
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -532,6 +532,10 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
}
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
if (!cmd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
if (asuser) {
|
||||
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
@@ -20,5 +20,5 @@ var_dump( ArrayProperty::$array );
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(23)
|
||||
int(42)
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #50816 (Using class constants in array definition fails)
|
||||
--FILE--
|
||||
<?php
|
||||
define("ONE", 1);
|
||||
define("TWO", 1);
|
||||
|
||||
class Foo {
|
||||
const ONE = 1;
|
||||
const TWO = 1;
|
||||
|
||||
public static $mapWithConst = array(self::ONE => 'one', self::TWO => 'two',);
|
||||
|
||||
public static $mapWithConst1 = array(1 => 'one', self::TWO => 'two',);
|
||||
public static $mapWithConst2 = array(self::ONE => 'one', 1 => 'two',);
|
||||
|
||||
public static $mapWithoutConst = array(1 => 'one', 1 => 'two',);
|
||||
}
|
||||
|
||||
$mapWithConst = array(1 => 'one', 1 => 'two',);
|
||||
|
||||
$mapWithoutConst = array(Foo::ONE => 'one', Foo::TWO => 'two',);
|
||||
$mapWithoutConst0 = array(1 => 'one', 1 => 'two',);
|
||||
$mapWithoutConst1 = array(ONE => 'one', 1 => 'two',);
|
||||
$mapWithoutConst2 = array(1 => 'one', TWO => 'two',);
|
||||
$mapWithoutConst3 = array(ONE => 'one', TWO => 'two',);
|
||||
|
||||
var_dump(Foo::$mapWithConst[1]);
|
||||
var_dump(Foo::$mapWithConst1[1]);
|
||||
var_dump(Foo::$mapWithConst2[1]);
|
||||
var_dump(Foo::$mapWithoutConst[1]);
|
||||
var_dump($mapWithConst[1]);
|
||||
var_dump($mapWithoutConst[1]);
|
||||
var_dump($mapWithoutConst0[1]);
|
||||
var_dump($mapWithoutConst1[1]);
|
||||
var_dump($mapWithoutConst2[1]);
|
||||
var_dump($mapWithoutConst3[1]);
|
||||
--EXPECT--
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
|
||||
--FILE--
|
||||
<?php
|
||||
interface MyInterface {
|
||||
const TEST_CONSTANT = true;
|
||||
}
|
||||
|
||||
class ParentClass implements MyInterface { }
|
||||
|
||||
class ChildClass extends ParentClass { }
|
||||
|
||||
echo (is_subclass_of('ChildClass', 'MyInterface') ? 'true' : 'false') . "\n";
|
||||
echo (defined('ChildClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
|
||||
|
||||
echo (is_subclass_of('ParentClass', 'MyInterface') ? 'true' : 'false') . "\n";
|
||||
echo (defined('ParentClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
|
||||
--EXPECT--
|
||||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
Bug #54039 (use() of static variables in lambda functions can break staticness)
|
||||
--FILE--
|
||||
<?php
|
||||
function test_1() {
|
||||
static $v = 0;
|
||||
++$v;
|
||||
echo "Outer function increments \$v to $v\n";
|
||||
$f = function() use($v) {
|
||||
echo "Inner function reckons \$v is $v\n";
|
||||
};
|
||||
return $f;
|
||||
}
|
||||
|
||||
$f = test_1(); $f();
|
||||
$f = test_1(); $f();
|
||||
|
||||
function test_2() {
|
||||
static $v = 0;
|
||||
$f = function() use($v) {
|
||||
echo "Inner function reckons \$v is $v\n";
|
||||
};
|
||||
++$v;
|
||||
echo "Outer function increments \$v to $v\n";
|
||||
return $f;
|
||||
}
|
||||
|
||||
$f = test_2(); $f();
|
||||
$f = test_2(); $f();
|
||||
|
||||
function test_3() {
|
||||
static $v = "";
|
||||
$v .= 'b';
|
||||
echo "Outer function catenates 'b' onto \$v to give $v\n";
|
||||
$f = function() use($v) {
|
||||
echo "Inner function reckons \$v is $v\n";
|
||||
};
|
||||
$v .= 'a';
|
||||
echo "Outer function catenates 'a' onto \$v to give $v\n";
|
||||
return $f;
|
||||
}
|
||||
$f = test_3(); $f();
|
||||
$f = test_3(); $f();
|
||||
--EXPECT--
|
||||
Outer function increments $v to 1
|
||||
Inner function reckons $v is 1
|
||||
Outer function increments $v to 2
|
||||
Inner function reckons $v is 2
|
||||
Outer function increments $v to 1
|
||||
Inner function reckons $v is 0
|
||||
Outer function increments $v to 2
|
||||
Inner function reckons $v is 1
|
||||
Outer function catenates 'b' onto $v to give b
|
||||
Outer function catenates 'a' onto $v to give ba
|
||||
Inner function reckons $v is b
|
||||
Outer function catenates 'b' onto $v to give bab
|
||||
Outer function catenates 'a' onto $v to give baba
|
||||
Inner function reckons $v is bab
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #54262 (Crash when assigning value to a dimension in a non-array)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = '0';
|
||||
var_dump(isset($a['b']));
|
||||
$simpleString = preg_match('//', '', $a->a);
|
||||
$simpleString["wrong"] = "f";
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
|
||||
Warning: Attempt to modify property of non-object in %s/Zend/tests/bug54262.php on line 4
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %s/Zend/tests/bug54262.php on line 5
|
||||
ok
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #54265 (crash when variable gets reassigned in error handler)
|
||||
--FILE--
|
||||
<?php
|
||||
function my_errorhandler($errno,$errormsg) {
|
||||
global $my_var;
|
||||
$my_var = 0;
|
||||
echo "EROOR: $errormsg\n";
|
||||
}
|
||||
set_error_handler("my_errorhandler");
|
||||
$my_var = str_repeat("A",$my_var[0]->errormsg = "xyz");
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
EROOR: Creating default object from empty value
|
||||
ok
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Bug #54268 (Double free when destroy_zend_class fails)
|
||||
--INI--
|
||||
memory_limit=8M
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class DestructableObject
|
||||
{
|
||||
public function __destruct()
|
||||
{
|
||||
DestructableObject::__destruct();
|
||||
}
|
||||
}
|
||||
class DestructorCreator
|
||||
{
|
||||
public function __destruct()
|
||||
{
|
||||
$this->test = new DestructableObject;
|
||||
}
|
||||
}
|
||||
class Test
|
||||
{
|
||||
public static $mystatic;
|
||||
}
|
||||
$x = new Test();
|
||||
Test::$mystatic = new DestructorCreator();
|
||||
--EXPECTF--
|
||||
Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #54305 (Crash in gc_remove_zval_from_buffer)
|
||||
--FILE--
|
||||
<?php
|
||||
class TestClass {
|
||||
public function methodWithArgs($a, $b) {
|
||||
}
|
||||
}
|
||||
abstract class AbstractClass {
|
||||
}
|
||||
$methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs');
|
||||
echo $methodWithArgs++;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Method [ <user> public method methodWithArgs ] {
|
||||
@@ %sbug54305.php %d - %d
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $a ]
|
||||
Parameter #1 [ <required> $b ]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
--TEST--
|
||||
Bug #54358 (Closure, use and reference)
|
||||
--FILE--
|
||||
<?php
|
||||
class asserter {
|
||||
public function call($function) {
|
||||
}
|
||||
}
|
||||
|
||||
$asserter = new asserter();
|
||||
|
||||
$closure = function() use ($asserter, &$function) {
|
||||
$asserter->call($function = 'md5');
|
||||
};
|
||||
|
||||
$closure();
|
||||
|
||||
var_dump($function);
|
||||
|
||||
$closure = function() use ($asserter, $function) {
|
||||
$asserter->call($function);
|
||||
};
|
||||
|
||||
$closure();
|
||||
|
||||
var_dump($function);
|
||||
|
||||
$closure = function() use ($asserter, $function) {
|
||||
$asserter->call($function);
|
||||
};
|
||||
|
||||
$closure();
|
||||
|
||||
var_dump($function);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "md5"
|
||||
string(3) "md5"
|
||||
string(3) "md5"
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #54367 (Use of closure causes problem in ArrayAccess)
|
||||
--FILE--
|
||||
<?php
|
||||
class MyObjet implements ArrayAccess
|
||||
{
|
||||
public function offsetSet($offset, $value) { }
|
||||
public function offsetExists($offset) { }
|
||||
public function offsetUnset($offset) { }
|
||||
|
||||
public function offsetGet ($offset)
|
||||
{
|
||||
return function ($var) use ($offset) { // here is the problem
|
||||
var_dump($offset, $var);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
$a = new MyObjet();
|
||||
echo $a['p']('foo');
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "p"
|
||||
string(3) "foo"
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #54372 (Crash accessing global object itself returned from its __get() handle)
|
||||
--FILE--
|
||||
<?php
|
||||
class test_class
|
||||
{
|
||||
public function __get($name)
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function b()
|
||||
{
|
||||
echo "ok\n";
|
||||
}
|
||||
}
|
||||
|
||||
global $test3;
|
||||
$test3 = new test_class();
|
||||
$test3->a->b();
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #54585 (track_errors causes segfault)
|
||||
--INI--
|
||||
track_errors=On
|
||||
--FILE--
|
||||
<?php
|
||||
function testing($source) {
|
||||
unset($source[$cos]);
|
||||
}
|
||||
testing($_GET);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: cos in %sbug54585.php on line 3
|
||||
ok
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #54624 (class_alias and type hint)
|
||||
--FILE--
|
||||
<?php
|
||||
class A
|
||||
{
|
||||
function foo(A $param) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class_alias('A', 'AliasA');
|
||||
|
||||
eval('
|
||||
class B extends A
|
||||
{
|
||||
function foo(AliasA $param) {
|
||||
}
|
||||
|
||||
}
|
||||
');
|
||||
|
||||
echo "DONE\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
DONE
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
namespace b\c {}
|
||||
namespace b\d {}
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #54804 (__halt_compiler and imported namespaces)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace a;
|
||||
require __DIR__ . '/bug54804.inc';
|
||||
echo 'DONE';
|
||||
__halt_compiler();
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #54910 (Crash when calling call_user_func with unknown function name)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function __call($method, $args) {
|
||||
if (stripos($method, 'get') === 0) {
|
||||
return $this->get();
|
||||
}
|
||||
die("No such method - '$method'\n");
|
||||
}
|
||||
|
||||
protected function get() {
|
||||
$class = get_class($this);
|
||||
$call = array($class, 'noSuchMethod');
|
||||
|
||||
if (is_callable($call)) {
|
||||
call_user_func($call);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$input = new B();
|
||||
echo $input->getEmail();
|
||||
--EXPECT--
|
||||
No such method - 'noSuchMethod'
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #55007 (compiler fail after previous fail)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function __autoload($classname) {
|
||||
if ('CompileErrorClass'==$classname) eval('class CompileErrorClass { function foo() { $a[] } }');
|
||||
if ('MyErrorHandler'==$classname) eval('class MyErrorHandler { function __construct() { print "My error handler runs.\n"; } }');
|
||||
}
|
||||
|
||||
function shutdown() {
|
||||
new MyErrorHandler();
|
||||
}
|
||||
|
||||
|
||||
register_shutdown_function('shutdown');
|
||||
|
||||
new CompileErrorClass();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use [] for reading in %s(%d) : eval()'d code on line %d
|
||||
My error handler runs.
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #55156 (ReflectionClass::getDocComment() returns comment even though the class has none)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/** test */
|
||||
namespace foo {
|
||||
function test() { }
|
||||
|
||||
$x = new \ReflectionFunction('foo\test');
|
||||
var_dump($x->getDocComment());
|
||||
|
||||
/** test1 */
|
||||
class bar { }
|
||||
|
||||
/** test2 */
|
||||
class foo extends namespace\bar { }
|
||||
|
||||
$x = new \ReflectionClass('foo\bar');
|
||||
var_dump($x->getDocComment());
|
||||
|
||||
$x = new \ReflectionClass('foo\foo');
|
||||
var_dump($x->getDocComment());
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
string(12) "/** test1 */"
|
||||
string(12) "/** test2 */"
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #55339 (Segfault with allow_call_time_pass_reference = Off)
|
||||
--INI--
|
||||
allow_call_time_pass_reference=off
|
||||
--FILE--
|
||||
<?php
|
||||
function error_handler($errno, $errstr, $errfile, $errline) {
|
||||
eval(';');
|
||||
}
|
||||
|
||||
set_error_handler('error_handler');
|
||||
|
||||
eval(<<<'EOF'
|
||||
function foo()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($array as $key => $value) {
|
||||
bar($key, &$value);
|
||||
}
|
||||
}
|
||||
|
||||
function bar()
|
||||
{
|
||||
|
||||
}
|
||||
EOF
|
||||
);
|
||||
|
||||
echo "OK\n";
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
concat difffent types
|
||||
concat different types
|
||||
--INI--
|
||||
precision=14
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Persistent case insensetive and user defined constants
|
||||
Persistent case insensitive and user defined constants
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(ZEND_THREAD_safe);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Argument parsing error #001
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($arg1 string) {}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected T_STRING, expecting ')' in %sfunction_arguments_001.php on line %d
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Argument parsing error #002
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($arg1/) {}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '/', expecting ')' in %sfunction_arguments_002.php on line %d
|
||||
|
||||
@@ -38,6 +38,6 @@ bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
AUTOLOAD 'X1'
|
||||
bool(false)
|
||||
+45
-3
@@ -808,6 +808,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
|
||||
exit(-1);
|
||||
}
|
||||
CG(unclean_shutdown) = 1;
|
||||
CG(active_class_entry) = NULL;
|
||||
CG(in_compilation) = EG(in_execution) = 0;
|
||||
EG(current_execute_data) = NULL;
|
||||
LONGJMP(*EG(bailout), FAILURE);
|
||||
@@ -820,7 +821,7 @@ void zend_append_version_info(const zend_extension *extension) /* {{{ */
|
||||
char *new_info;
|
||||
uint new_info_length;
|
||||
|
||||
new_info_length = sizeof(" with v, by \n")
|
||||
new_info_length = sizeof(" with v, , by \n")
|
||||
+ strlen(extension->name)
|
||||
+ strlen(extension->version)
|
||||
+ strlen(extension->copyright)
|
||||
@@ -828,10 +829,10 @@ void zend_append_version_info(const zend_extension *extension) /* {{{ */
|
||||
|
||||
new_info = (char *) malloc(new_info_length + 1);
|
||||
|
||||
sprintf(new_info, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author);
|
||||
snprintf(new_info, new_info_length, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author);
|
||||
|
||||
zend_version_info = (char *) realloc(zend_version_info, zend_version_info_length+new_info_length + 1);
|
||||
strcat(zend_version_info, new_info);
|
||||
strncat(zend_version_info, new_info, new_info_length);
|
||||
zend_version_info_length += new_info_length;
|
||||
free(new_info);
|
||||
}
|
||||
@@ -957,6 +958,23 @@ ZEND_API int zend_get_configuration_directive(const char *name, uint name_length
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#define SAVE_STACK(stack) do { \
|
||||
if (CG(stack).top) { \
|
||||
memcpy(&stack, &CG(stack), sizeof(zend_stack)); \
|
||||
CG(stack).top = CG(stack).max = 0; \
|
||||
CG(stack).elements = NULL; \
|
||||
} else { \
|
||||
stack.top = 0; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define RESTORE_STACK(stack) do { \
|
||||
if (stack.top) { \
|
||||
zend_stack_destroy(&CG(stack)); \
|
||||
memcpy(&CG(stack), &stack, sizeof(zend_stack)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
{
|
||||
va_list args;
|
||||
@@ -969,6 +987,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
zval *orig_user_error_handler;
|
||||
zend_bool in_compilation;
|
||||
zend_class_entry *saved_class_entry;
|
||||
zend_stack bp_stack;
|
||||
zend_stack function_call_stack;
|
||||
zend_stack switch_cond_stack;
|
||||
zend_stack foreach_copy_stack;
|
||||
zend_stack object_stack;
|
||||
zend_stack declare_stack;
|
||||
zend_stack list_stack;
|
||||
zend_stack labels_stack;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
/* Obtain relevant filename and lineno */
|
||||
@@ -1096,6 +1122,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
if (in_compilation) {
|
||||
saved_class_entry = CG(active_class_entry);
|
||||
CG(active_class_entry) = NULL;
|
||||
SAVE_STACK(bp_stack);
|
||||
SAVE_STACK(function_call_stack);
|
||||
SAVE_STACK(switch_cond_stack);
|
||||
SAVE_STACK(foreach_copy_stack);
|
||||
SAVE_STACK(object_stack);
|
||||
SAVE_STACK(declare_stack);
|
||||
SAVE_STACK(list_stack);
|
||||
SAVE_STACK(labels_stack);
|
||||
}
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
|
||||
@@ -1112,6 +1146,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
|
||||
if (in_compilation) {
|
||||
CG(active_class_entry) = saved_class_entry;
|
||||
RESTORE_STACK(bp_stack);
|
||||
RESTORE_STACK(function_call_stack);
|
||||
RESTORE_STACK(switch_cond_stack);
|
||||
RESTORE_STACK(foreach_copy_stack);
|
||||
RESTORE_STACK(object_stack);
|
||||
RESTORE_STACK(declare_stack);
|
||||
RESTORE_STACK(list_stack);
|
||||
RESTORE_STACK(labels_stack);
|
||||
}
|
||||
|
||||
if (!EG(user_error_handler)) {
|
||||
|
||||
+25
-2
@@ -941,6 +941,7 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
|
||||
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
|
||||
ce->name, get_active_function_name(TSRMLS_C), Z_OBJCE_P(this_ptr)->name, get_active_function_name(TSRMLS_C));
|
||||
}
|
||||
va_end(va);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -2082,6 +2083,22 @@ ZEND_API int zend_get_module_started(const char *module_name) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int clean_module_class(const zend_class_entry **ce, int *module_number TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((*ce)->type == ZEND_INTERNAL_CLASS && (*ce)->module->module_number == *module_number) {
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
} else {
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void clean_module_classes(int module_number TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_hash_apply_with_argument(EG(class_table), (apply_func_arg_t) clean_module_class, (void *) &module_number TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void module_destructor(zend_module_entry *module) /* {{{ */
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
@@ -2089,6 +2106,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
|
||||
if (module->type == MODULE_TEMPORARY) {
|
||||
zend_clean_module_rsrc_dtors(module->module_number TSRMLS_CC);
|
||||
clean_module_constants(module->module_number TSRMLS_CC);
|
||||
clean_module_classes(module->module_number TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (module->module_started && module->module_shutdown_func) {
|
||||
@@ -2290,7 +2308,7 @@ ZEND_API ZEND_FUNCTION(display_disabled_function)
|
||||
|
||||
static zend_function_entry disabled_function[] = {
|
||||
ZEND_FE(display_disabled_function, NULL)
|
||||
{ NULL, NULL, NULL }
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
|
||||
@@ -2316,7 +2334,7 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR
|
||||
/* }}} */
|
||||
|
||||
static const zend_function_entry disabled_class_new[] = {
|
||||
{ NULL, NULL, NULL }
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
|
||||
@@ -2573,6 +2591,11 @@ get_function_via_handler:
|
||||
if (fcc->function_handler) {
|
||||
retval = 1;
|
||||
call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
|
||||
if (call_via_handler && !fcc->object_ptr && EG(This) &&
|
||||
Z_OBJ_HT_P(EG(This))->get_class_entry &&
|
||||
instanceof_function(Z_OBJCE_P(EG(This)), fcc->calling_scope TSRMLS_CC)) {
|
||||
fcc->object_ptr = EG(This);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ typedef struct _zend_fcall_info_cache {
|
||||
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
|
||||
#define ZEND_NS_DEP_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED)
|
||||
|
||||
#define ZEND_FE_END { NULL, NULL, NULL, 0, 0 }
|
||||
|
||||
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
|
||||
#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
|
||||
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, 0, allow_null, pass_by_ref, 0, 0 },
|
||||
|
||||
@@ -283,7 +283,7 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
ZEND_FE(gc_enabled, arginfo_zend__void)
|
||||
ZEND_FE(gc_enable, arginfo_zend__void)
|
||||
ZEND_FE(gc_disable, arginfo_zend__void)
|
||||
{ NULL, NULL, NULL }
|
||||
ZEND_FE_END
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -822,45 +822,25 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
|
||||
return;
|
||||
}
|
||||
|
||||
if (only_subclass && Z_TYPE_P(obj) == IS_STRING) {
|
||||
if (Z_TYPE_P(obj) == IS_STRING) {
|
||||
zend_class_entry **the_ce;
|
||||
if (zend_lookup_class(Z_STRVAL_P(obj), Z_STRLEN_P(obj), &the_ce TSRMLS_CC) == FAILURE) {
|
||||
zend_error(E_WARNING, "Unknown class passed as parameter");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
instance_ce = *the_ce;
|
||||
} else if (Z_TYPE_P(obj) != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
} else if (Z_TYPE_P(obj) == IS_OBJECT && HAS_CLASS_ENTRY(*obj)) {
|
||||
instance_ce = Z_OBJCE_P(obj);
|
||||
} else {
|
||||
instance_ce = NULL;
|
||||
}
|
||||
|
||||
/* TBI!! new object handlers */
|
||||
if (Z_TYPE_P(obj) == IS_OBJECT && !HAS_CLASS_ENTRY(*obj)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_lookup_class_ex(class_name, class_name_len, 0, &ce TSRMLS_CC) == FAILURE) {
|
||||
retval = 0;
|
||||
} else {
|
||||
if (only_subclass) {
|
||||
if (!instance_ce) {
|
||||
instance_ce = Z_OBJCE_P(obj)->parent;
|
||||
} else {
|
||||
instance_ce = instance_ce->parent;
|
||||
}
|
||||
} else {
|
||||
instance_ce = Z_OBJCE_P(obj);
|
||||
}
|
||||
|
||||
if (!instance_ce) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (instanceof_function(instance_ce, *ce TSRMLS_CC)) {
|
||||
retval = 1;
|
||||
} else {
|
||||
if (only_subclass && instance_ce == *ce) {
|
||||
retval = 0;
|
||||
} else {
|
||||
retval = instanceof_function(instance_ce, *ce TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1733,7 +1713,7 @@ ZEND_FUNCTION(create_function)
|
||||
function_name[0] = '\0';
|
||||
|
||||
do {
|
||||
function_name_length = 1 + sprintf(function_name + 1, "lambda_%d", ++EG(lambda_count));
|
||||
function_name_length = 1 + snprintf(function_name + 1, sizeof("lambda_")+MAX_LENGTH_OF_LONG, "lambda_%d", ++EG(lambda_count));
|
||||
} while (zend_hash_add(EG(function_table), function_name, function_name_length+1, &new_function, sizeof(zend_function), NULL)==FAILURE);
|
||||
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
|
||||
RETURN_STRINGL(function_name, function_name_length, 0);
|
||||
@@ -2067,7 +2047,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
ZEND_PUTS(class_name);
|
||||
ZEND_PUTS(call_type);
|
||||
}
|
||||
zend_printf("%s(", function_name?function_name:"main");
|
||||
zend_printf("%s(", function_name);
|
||||
if (arg_array) {
|
||||
debug_print_backtrace_args(arg_array TSRMLS_CC);
|
||||
zval_ptr_dtor(&arg_array);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
int zend_startup_builtin_functions(TSRMLS_D);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int provide_object TSRMLS_DC);
|
||||
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options TSRMLS_DC);
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* ZEND_BUILTIN_FUNCTIONS_H */
|
||||
|
||||
@@ -347,6 +347,7 @@ static int zval_copy_static_var(zval **p TSRMLS_DC, int num_args, va_list args,
|
||||
} else if (Z_ISREF_PP(p)) {
|
||||
ALLOC_INIT_ZVAL(tmp);
|
||||
*tmp = **p;
|
||||
zval_copy_ctor(tmp);
|
||||
Z_SET_REFCOUNT_P(tmp, 0);
|
||||
Z_UNSET_ISREF_P(tmp);
|
||||
} else {
|
||||
@@ -372,6 +373,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func TSRMLS_DC) /* {
|
||||
closure = (zend_closure *)zend_object_store_get_object(res TSRMLS_CC);
|
||||
|
||||
closure->func = *func;
|
||||
closure->func.common.prototype = NULL;
|
||||
|
||||
if (closure->func.type == ZEND_USER_FUNCTION) {
|
||||
if (closure->func.op_array.static_variables) {
|
||||
|
||||
+35
-14
@@ -2529,7 +2529,7 @@ static void do_inherit_method(zend_function *function) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto) /* {{{ */
|
||||
static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_uint i;
|
||||
|
||||
@@ -2572,11 +2572,24 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
|
||||
&& strcasecmp(fe->common.arg_info[i].class_name, proto->common.arg_info[i].class_name)!=0) {
|
||||
char *colon;
|
||||
|
||||
if (fe->common.type != ZEND_USER_FUNCTION ||
|
||||
strchr(proto->common.arg_info[i].class_name, '\\') != NULL ||
|
||||
(colon = zend_memrchr(fe->common.arg_info[i].class_name, '\\', fe->common.arg_info[i].class_name_len)) == NULL ||
|
||||
strcasecmp(colon+1, proto->common.arg_info[i].class_name) != 0) {
|
||||
if (fe->common.type != ZEND_USER_FUNCTION) {
|
||||
return 0;
|
||||
} else if (strchr(proto->common.arg_info[i].class_name, '\\') != NULL ||
|
||||
(colon = zend_memrchr(fe->common.arg_info[i].class_name, '\\', fe->common.arg_info[i].class_name_len)) == NULL ||
|
||||
strcasecmp(colon+1, proto->common.arg_info[i].class_name) != 0) {
|
||||
zend_class_entry **fe_ce, **proto_ce;
|
||||
int found, found2;
|
||||
|
||||
found = zend_lookup_class(fe->common.arg_info[i].class_name, fe->common.arg_info[i].class_name_len, &fe_ce TSRMLS_CC);
|
||||
found2 = zend_lookup_class(proto->common.arg_info[i].class_name, proto->common.arg_info[i].class_name_len, &proto_ce TSRMLS_CC);
|
||||
|
||||
/* Check for class alias */
|
||||
if (found != SUCCESS || found2 != SUCCESS ||
|
||||
(*fe_ce)->type == ZEND_INTERNAL_CLASS ||
|
||||
(*proto_ce)->type == ZEND_INTERNAL_CLASS ||
|
||||
*fe_ce != *proto_ce) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fe->common.arg_info[i].array_type_hint != proto->common.arg_info[i].array_type_hint) {
|
||||
@@ -2668,11 +2681,11 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
|
||||
}
|
||||
|
||||
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
|
||||
}
|
||||
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
|
||||
if (!zend_do_perform_implementation_check(child, parent)) {
|
||||
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
|
||||
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(parent), parent->common.function_name);
|
||||
}
|
||||
}
|
||||
@@ -3749,6 +3762,10 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */
|
||||
zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, cfilename, clen, 0);
|
||||
zend_register_long_constant(name, len+1, zend_get_scanned_file_offset(TSRMLS_C), CONST_CS, 0 TSRMLS_CC);
|
||||
pefree(name, 0);
|
||||
|
||||
if (CG(in_namespace)) {
|
||||
zend_do_end_namespace(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4897,14 +4914,12 @@ void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */
|
||||
|
||||
void zend_do_ticks(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
if (Z_LVAL(CG(declarables).ticks)) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_TICKS;
|
||||
opline->op1.u.constant = CG(declarables).ticks;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
opline->opcode = ZEND_TICKS;
|
||||
opline->op1.u.constant = CG(declarables).ticks;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -5305,6 +5320,12 @@ void zend_do_end_namespace(TSRMLS_D) /* {{{ */
|
||||
efree(CG(current_import));
|
||||
CG(current_import) = NULL;
|
||||
}
|
||||
|
||||
if (CG(doc_comment)) {
|
||||
efree(CG(doc_comment));
|
||||
CG(doc_comment) = NULL;
|
||||
CG(doc_comment_len) = 0;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#define INC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count++); }
|
||||
#define DEC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count--); }
|
||||
#define HANDLE_INTERACTIVE() if (CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) { execute_new_code(TSRMLS_C); }
|
||||
#define DO_TICKS() if (Z_LVAL(CG(declarables).ticks)) { zend_do_ticks(TSRMLS_C); }
|
||||
|
||||
#define RESET_DOC_COMMENT() \
|
||||
{ \
|
||||
|
||||
+14
-2
@@ -536,10 +536,22 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
|
||||
(Z_TYPE_P(object) == IS_BOOL && Z_LVAL_P(object) == 0) ||
|
||||
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
|
||||
zval_dtor(*object_ptr);
|
||||
object_init(*object_ptr);
|
||||
object = *object_ptr;
|
||||
Z_ADDREF_P(object);
|
||||
zend_error(E_STRICT, "Creating default object from empty value");
|
||||
if (Z_REFCOUNT_P(object) == 1) {
|
||||
/* object was removed by error handler, nothing to assign to */
|
||||
zval_ptr_dtor(&object);
|
||||
if (retval) {
|
||||
*retval = &EG(uninitialized_zval);
|
||||
PZVAL_LOCK(*retval);
|
||||
}
|
||||
FREE_OP(free_value);
|
||||
return;
|
||||
}
|
||||
Z_DELREF_P(object);
|
||||
zval_dtor(object);
|
||||
object_init(object);
|
||||
} else {
|
||||
zend_error(E_WARNING, "Attempt to assign property of non-object");
|
||||
if (!RETURN_VALUE_UNUSED(result)) {
|
||||
|
||||
+13
-9
@@ -296,7 +296,9 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
|
||||
zend_hash_reverse_apply(EG(function_table), (apply_func_t) zend_cleanup_function_data TSRMLS_CC);
|
||||
}
|
||||
zend_hash_apply(EG(class_table), (apply_func_t) zend_cleanup_class_data TSRMLS_CC);
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
zend_vm_stack_destroy(TSRMLS_C);
|
||||
|
||||
zend_objects_store_free_object_storage(&EG(objects_store) TSRMLS_CC);
|
||||
@@ -431,26 +433,28 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */
|
||||
|
||||
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
|
||||
{
|
||||
zval *zv = *zval_ptr;
|
||||
|
||||
#if DEBUG_ZEND>=2
|
||||
printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, Z_REFCOUNT_PP(zval_ptr), Z_REFCOUNT_PP(zval_ptr) - 1);
|
||||
#endif
|
||||
Z_DELREF_PP(zval_ptr);
|
||||
if (Z_REFCOUNT_PP(zval_ptr) == 0) {
|
||||
Z_DELREF_P(zv);
|
||||
if (Z_REFCOUNT_P(zv) == 0) {
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (*zval_ptr != &EG(uninitialized_zval)) {
|
||||
GC_REMOVE_ZVAL_FROM_BUFFER(*zval_ptr);
|
||||
zval_dtor(*zval_ptr);
|
||||
efree_rel(*zval_ptr);
|
||||
if (zv != &EG(uninitialized_zval)) {
|
||||
GC_REMOVE_ZVAL_FROM_BUFFER(zv);
|
||||
zval_dtor(zv);
|
||||
efree_rel(zv);
|
||||
}
|
||||
} else {
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (Z_REFCOUNT_PP(zval_ptr) == 1) {
|
||||
Z_UNSET_ISREF_PP(zval_ptr);
|
||||
if (Z_REFCOUNT_P(zv) == 1) {
|
||||
Z_UNSET_ISREF_P(zv);
|
||||
}
|
||||
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(*zval_ptr);
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(zv);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+107
-84
@@ -545,9 +545,15 @@ ZEND_API void zend_hash_clean(HashTable *ht)
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
SET_INCONSISTENT(HT_CLEANING);
|
||||
|
||||
p = ht->pListHead;
|
||||
|
||||
memset(ht->arBuckets, 0, ht->nTableSize*sizeof(Bucket *));
|
||||
ht->pListHead = NULL;
|
||||
ht->pListTail = NULL;
|
||||
ht->nNumOfElements = 0;
|
||||
ht->nNextFreeElement = 0;
|
||||
ht->pInternalPointer = NULL;
|
||||
|
||||
while (p != NULL) {
|
||||
q = p;
|
||||
p = p->pListNext;
|
||||
@@ -559,14 +565,6 @@ ZEND_API void zend_hash_clean(HashTable *ht)
|
||||
}
|
||||
pefree(q, ht->persistent);
|
||||
}
|
||||
memset(ht->arBuckets, 0, ht->nTableSize*sizeof(Bucket *));
|
||||
ht->pListHead = NULL;
|
||||
ht->pListTail = NULL;
|
||||
ht->nNumOfElements = 0;
|
||||
ht->nNextFreeElement = 0;
|
||||
ht->pInternalPointer = NULL;
|
||||
|
||||
SET_INCONSISTENT(HT_OK);
|
||||
}
|
||||
|
||||
/* This function is used by the various apply() functions.
|
||||
@@ -737,6 +735,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
|
||||
p = p->pListNext;
|
||||
}
|
||||
if (result & ZEND_HASH_APPLY_STOP) {
|
||||
va_end(args);
|
||||
break;
|
||||
}
|
||||
va_end(args);
|
||||
@@ -1170,12 +1169,12 @@ ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosi
|
||||
}
|
||||
}
|
||||
|
||||
/* This function changes key of currevt element without changing elements'
|
||||
/* This function changes key of current element without changing elements'
|
||||
* order. If element with target key already exists, it will be deleted first.
|
||||
*/
|
||||
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, uint str_length, ulong num_index, int mode, HashPosition *pos)
|
||||
{
|
||||
Bucket *p;
|
||||
Bucket *p, *q;
|
||||
|
||||
p = pos ? (*pos) : ht->pInternalPointer;
|
||||
|
||||
@@ -1188,100 +1187,124 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (mode != HASH_UPDATE_KEY_ANYWAY) {
|
||||
Bucket *q = ht->arBuckets[num_index & ht->nTableMask];
|
||||
int found = 0;
|
||||
|
||||
while (q != NULL) {
|
||||
if (q == p) {
|
||||
found = 1;
|
||||
} else if (!q->nKeyLength && q->h == num_index) {
|
||||
if (found) {
|
||||
if (mode & HASH_UPDATE_KEY_IF_BEFORE) {
|
||||
break;
|
||||
} else {
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_del(ht, p->arKey, p->nKeyLength);
|
||||
} else {
|
||||
zend_hash_index_del(ht, p->h);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
} else {
|
||||
if (mode & HASH_UPDATE_KEY_IF_AFTER) {
|
||||
break;
|
||||
} else {
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_del(ht, p->arKey, p->nKeyLength);
|
||||
} else {
|
||||
zend_hash_index_del(ht, p->h);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
q = q->pNext;
|
||||
q = ht->arBuckets[num_index & ht->nTableMask];
|
||||
while (q != NULL) {
|
||||
if (!q->nKeyLength && q->h == num_index) {
|
||||
break;
|
||||
}
|
||||
q = q->pNext;
|
||||
}
|
||||
|
||||
zend_hash_index_del(ht, num_index);
|
||||
} else if (key_type == HASH_KEY_IS_STRING) {
|
||||
ulong h;
|
||||
|
||||
if (p->nKeyLength == str_length &&
|
||||
memcmp(p->arKey, str_index, str_length) == 0) {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (mode != HASH_UPDATE_KEY_ANYWAY) {
|
||||
ulong h = zend_inline_hash_func(str_index, str_length);
|
||||
Bucket *q = ht->arBuckets[h & ht->nTableMask];
|
||||
int found = 0;
|
||||
h = zend_inline_hash_func(str_index, str_length);
|
||||
q = ht->arBuckets[h & ht->nTableMask];
|
||||
|
||||
while (q != NULL) {
|
||||
if (q == p) {
|
||||
found = 1;
|
||||
} else if (q->h == h && q->nKeyLength == str_length &&
|
||||
memcmp(q->arKey, str_index, str_length) == 0) {
|
||||
if (found) {
|
||||
if (mode & HASH_UPDATE_KEY_IF_BEFORE) {
|
||||
break;
|
||||
} else {
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_del(ht, p->arKey, p->nKeyLength);
|
||||
} else {
|
||||
zend_hash_index_del(ht, p->h);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
} else {
|
||||
if (mode & HASH_UPDATE_KEY_IF_AFTER) {
|
||||
break;
|
||||
} else {
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_del(ht, p->arKey, p->nKeyLength);
|
||||
} else {
|
||||
zend_hash_index_del(ht, p->h);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
q = q->pNext;
|
||||
while (q != NULL) {
|
||||
if (q->h == h && q->nKeyLength == str_length &&
|
||||
memcmp(q->arKey, str_index, str_length) == 0) {
|
||||
break;
|
||||
}
|
||||
q = q->pNext;
|
||||
}
|
||||
|
||||
zend_hash_del(ht, str_index, str_length);
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
if (q) {
|
||||
if (mode != HASH_UPDATE_KEY_ANYWAY) {
|
||||
Bucket *r = p->pListLast;
|
||||
int found = HASH_UPDATE_KEY_IF_BEFORE;
|
||||
|
||||
while (r) {
|
||||
if (r == q) {
|
||||
found = HASH_UPDATE_KEY_IF_AFTER;
|
||||
break;
|
||||
}
|
||||
r = r->pListLast;
|
||||
}
|
||||
if (mode & found) {
|
||||
/* delete current bucket */
|
||||
if (p == ht->arBuckets[p->h & ht->nTableMask]) {
|
||||
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
|
||||
} else {
|
||||
p->pLast->pNext = p->pNext;
|
||||
}
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
}
|
||||
if (p->pListLast != NULL) {
|
||||
p->pListLast->pListNext = p->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = p->pListNext;
|
||||
}
|
||||
if (p->pListNext != NULL) {
|
||||
p->pListNext->pListLast = p->pListLast;
|
||||
} else {
|
||||
ht->pListTail = p->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == p) {
|
||||
ht->pInternalPointer = p->pListNext;
|
||||
}
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(p->pData);
|
||||
}
|
||||
if (p->pData != &p->pDataPtr) {
|
||||
pefree(p->pData, ht->persistent);
|
||||
}
|
||||
pefree(p, ht->persistent);
|
||||
ht->nNumOfElements--;
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
/* delete another bucket with the same key */
|
||||
if (q == ht->arBuckets[q->h & ht->nTableMask]) {
|
||||
ht->arBuckets[q->h & ht->nTableMask] = q->pNext;
|
||||
} else {
|
||||
q->pLast->pNext = q->pNext;
|
||||
}
|
||||
if (q->pNext) {
|
||||
q->pNext->pLast = q->pLast;
|
||||
}
|
||||
if (q->pListLast != NULL) {
|
||||
q->pListLast->pListNext = q->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = q->pListNext;
|
||||
}
|
||||
if (q->pListNext != NULL) {
|
||||
q->pListNext->pListLast = q->pListLast;
|
||||
} else {
|
||||
ht->pListTail = q->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == q) {
|
||||
ht->pInternalPointer = q->pListNext;
|
||||
}
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(q->pData);
|
||||
}
|
||||
if (q->pData != &q->pDataPtr) {
|
||||
pefree(q->pData, ht->persistent);
|
||||
}
|
||||
pefree(q, ht->persistent);
|
||||
ht->nNumOfElements--;
|
||||
}
|
||||
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
}
|
||||
if (p->pLast) {
|
||||
p->pLast->pNext = p->pNext;
|
||||
} else{
|
||||
} else {
|
||||
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ inner_statement:
|
||||
|
||||
|
||||
statement:
|
||||
unticked_statement { zend_do_ticks(TSRMLS_C); }
|
||||
unticked_statement { DO_TICKS(); }
|
||||
| T_STRING ':' { zend_do_label(&$1 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
@@ -291,11 +291,11 @@ unset_variable:
|
||||
;
|
||||
|
||||
function_declaration_statement:
|
||||
unticked_function_declaration_statement { zend_do_ticks(TSRMLS_C); }
|
||||
unticked_function_declaration_statement { DO_TICKS(); }
|
||||
;
|
||||
|
||||
class_declaration_statement:
|
||||
unticked_class_declaration_statement { zend_do_ticks(TSRMLS_C); }
|
||||
unticked_class_declaration_statement { DO_TICKS(); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -113,6 +113,8 @@ struct _zend_module_entry {
|
||||
#define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL)
|
||||
#define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL)
|
||||
|
||||
#define ZEND_MOD_END { NULL, NULL, NULL, 0 }
|
||||
|
||||
struct _zend_module_dep {
|
||||
const char *name; /* module name */
|
||||
const char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */
|
||||
|
||||
@@ -374,7 +374,11 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) /*
|
||||
} else {
|
||||
retval = &EG(uninitialized_zval_ptr);
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
if (EXPECTED(*retval != object)) {
|
||||
zval_ptr_dtor(&object);
|
||||
} else {
|
||||
Z_DELREF_P(object);
|
||||
}
|
||||
} else {
|
||||
if (zobj->ce->__get && guard && guard->in_get == 1) {
|
||||
if (Z_STRVAL_P(member)[0] == '\0') {
|
||||
|
||||
+88
-63
@@ -900,10 +900,16 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY)
|
||||
zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE != IS_CONST &&
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
|
||||
zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (OP1_TYPE == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
@@ -2087,14 +2093,20 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
|
||||
} else {
|
||||
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP2_TYPE != IS_CONST &&
|
||||
if (OP2_TYPE != IS_CONST && OP2_TYPE != IS_TMP_VAR &&
|
||||
Z_TYPE_P(function_name) == IS_OBJECT &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
|
||||
if (EX(object)) {
|
||||
Z_ADDREF_P(EX(object));
|
||||
}
|
||||
FREE_OP2();
|
||||
if (OP2_TYPE == IS_VAR && OP2_FREE &&
|
||||
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
EX(fbc)->common.prototype = (zend_function*)function_name;
|
||||
} else {
|
||||
FREE_OP2();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -2159,6 +2171,10 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
|
||||
}
|
||||
}
|
||||
|
||||
if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) {
|
||||
zval_ptr_dtor((zval**)&op_array->prototype);
|
||||
}
|
||||
|
||||
nested = EX(nested);
|
||||
|
||||
zend_vm_stack_free(execute_data TSRMLS_CC);
|
||||
@@ -2694,10 +2710,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
}
|
||||
|
||||
if (OP1_TYPE == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
Z_DELREF_PP(varptr_ptr);
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
Z_SET_REFCOUNT_PP(varptr_ptr, 0);
|
||||
ALLOC_INIT_ZVAL(varptr);
|
||||
zend_vm_stack_push(varptr TSRMLS_CC);
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
@@ -3220,59 +3235,67 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
|
||||
}
|
||||
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
@@ -3421,12 +3444,14 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
|
||||
zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
zval *offset;
|
||||
|
||||
if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE != IS_VAR || container) {
|
||||
if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
|
||||
+356
-294
@@ -163,6 +163,10 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
|
||||
if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) {
|
||||
zval_ptr_dtor((zval**)&op_array->prototype);
|
||||
}
|
||||
|
||||
nested = EX(nested);
|
||||
|
||||
zend_vm_stack_free(execute_data TSRMLS_CC);
|
||||
@@ -750,14 +754,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
|
||||
} else {
|
||||
function_name = &opline->op2.u.constant;
|
||||
|
||||
if (IS_CONST != IS_CONST &&
|
||||
if (IS_CONST != IS_CONST && IS_CONST != IS_TMP_VAR &&
|
||||
Z_TYPE_P(function_name) == IS_OBJECT &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
|
||||
if (EX(object)) {
|
||||
Z_ADDREF_P(EX(object));
|
||||
}
|
||||
if (IS_CONST == IS_VAR && 0 &&
|
||||
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
EX(fbc)->common.prototype = (zend_function*)function_name;
|
||||
} else {
|
||||
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -944,14 +954,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
|
||||
} else {
|
||||
function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_TMP_VAR != IS_CONST &&
|
||||
if (IS_TMP_VAR != IS_CONST && IS_TMP_VAR != IS_TMP_VAR &&
|
||||
Z_TYPE_P(function_name) == IS_OBJECT &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
|
||||
if (EX(object)) {
|
||||
Z_ADDREF_P(EX(object));
|
||||
}
|
||||
zval_dtor(free_op2.var);
|
||||
if (IS_TMP_VAR == IS_VAR && 1 &&
|
||||
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
EX(fbc)->common.prototype = (zend_function*)function_name;
|
||||
} else {
|
||||
zval_dtor(free_op2.var);
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -1045,14 +1061,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
|
||||
} else {
|
||||
function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR != IS_CONST &&
|
||||
if (IS_VAR != IS_CONST && IS_VAR != IS_TMP_VAR &&
|
||||
Z_TYPE_P(function_name) == IS_OBJECT &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
|
||||
if (EX(object)) {
|
||||
Z_ADDREF_P(EX(object));
|
||||
}
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
if (IS_VAR == IS_VAR && (free_op2.var != NULL) &&
|
||||
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
EX(fbc)->common.prototype = (zend_function*)function_name;
|
||||
} else {
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -1169,14 +1191,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
|
||||
} else {
|
||||
function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (IS_CV != IS_CONST &&
|
||||
if (IS_CV != IS_CONST && IS_CV != IS_TMP_VAR &&
|
||||
Z_TYPE_P(function_name) == IS_OBJECT &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
|
||||
if (EX(object)) {
|
||||
Z_ADDREF_P(EX(object));
|
||||
}
|
||||
if (IS_CV == IS_VAR && 0 &&
|
||||
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
EX(fbc)->common.prototype = (zend_function*)function_name;
|
||||
} else {
|
||||
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -1296,10 +1324,16 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zval *z = &opline->op1.u.constant;
|
||||
|
||||
if (IS_CONST != IS_CONST &&
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
|
||||
zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_CONST == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
@@ -1881,69 +1915,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE ||
|
||||
Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
done:
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
}
|
||||
@@ -4589,10 +4620,16 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_TMP_VAR != IS_CONST &&
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
|
||||
zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_TMP_VAR == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
@@ -5166,69 +5203,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE ||
|
||||
Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
done:
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
}
|
||||
@@ -7848,10 +7882,16 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR != IS_CONST &&
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
|
||||
zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_VAR == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
@@ -8364,10 +8404,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
}
|
||||
|
||||
if (IS_VAR == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
Z_DELREF_PP(varptr_ptr);
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
Z_SET_REFCOUNT_PP(varptr_ptr, 0);
|
||||
ALLOC_INIT_ZVAL(varptr);
|
||||
zend_vm_stack_push(varptr TSRMLS_CC);
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
@@ -8547,69 +8586,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE ||
|
||||
Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
done:
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
}
|
||||
@@ -10731,12 +10767,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op1;
|
||||
zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
|
||||
zval *offset = &opline->op2.u.constant;
|
||||
zval *offset;
|
||||
|
||||
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = &opline->op2.u.constant;
|
||||
|
||||
if (IS_VAR != IS_VAR || container) {
|
||||
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -12480,12 +12518,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
|
||||
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR != IS_VAR || container) {
|
||||
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -14280,12 +14320,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
|
||||
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR != IS_VAR || container) {
|
||||
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -16666,12 +16708,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op1;
|
||||
zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
|
||||
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (IS_VAR != IS_VAR || container) {
|
||||
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -17858,12 +17902,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
|
||||
zend_op *opline = EX(opline);
|
||||
|
||||
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
|
||||
zval *offset = &opline->op2.u.constant;
|
||||
zval *offset;
|
||||
|
||||
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = &opline->op2.u.constant;
|
||||
|
||||
if (IS_UNUSED != IS_VAR || container) {
|
||||
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -18915,12 +18961,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op2;
|
||||
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
|
||||
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_UNUSED != IS_VAR || container) {
|
||||
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -19972,12 +20020,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op2;
|
||||
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
|
||||
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_UNUSED != IS_VAR || container) {
|
||||
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -21288,12 +21338,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
|
||||
zend_op *opline = EX(opline);
|
||||
|
||||
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
|
||||
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (IS_UNUSED != IS_VAR || container) {
|
||||
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -21733,10 +21785,16 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (IS_CV != IS_CONST &&
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
|
||||
zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_CV == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
@@ -22248,10 +22306,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
}
|
||||
|
||||
if (IS_CV == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
Z_DELREF_PP(varptr_ptr);
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
Z_SET_REFCOUNT_PP(varptr_ptr, 0);
|
||||
ALLOC_INIT_ZVAL(varptr);
|
||||
zend_vm_stack_push(varptr TSRMLS_CC);
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
@@ -22421,69 +22478,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE ||
|
||||
Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
switch (Z_LVAL(opline->op2.u.constant)) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
done:
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
}
|
||||
@@ -24298,12 +24352,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
|
||||
zend_op *opline = EX(opline);
|
||||
|
||||
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
|
||||
zval *offset = &opline->op2.u.constant;
|
||||
zval *offset;
|
||||
|
||||
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = &opline->op2.u.constant;
|
||||
|
||||
if (IS_CV != IS_VAR || container) {
|
||||
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -25938,12 +25994,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op2;
|
||||
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
|
||||
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_CV != IS_VAR || container) {
|
||||
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -27628,12 +27686,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
|
||||
zend_op *opline = EX(opline);
|
||||
zend_free_op free_op2;
|
||||
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
|
||||
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
|
||||
|
||||
if (IS_CV != IS_VAR || container) {
|
||||
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
@@ -29805,12 +29865,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
|
||||
zend_op *opline = EX(opline);
|
||||
|
||||
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
|
||||
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
zval *offset;
|
||||
|
||||
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (IS_CV != IS_VAR || container) {
|
||||
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
}
|
||||
switch (Z_TYPE_PP(container)) {
|
||||
case IS_ARRAY: {
|
||||
HashTable *ht = Z_ARRVAL_PP(container);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -24,7 +24,7 @@ $header_text = <<< DATA
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+2
-1
@@ -2398,6 +2398,7 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
])
|
||||
LIBS=$old_LIBS
|
||||
PHP_ADD_LIBRARY(ssl,,$1)
|
||||
PHP_ADD_LIBRARY(crypto,,$1)
|
||||
|
||||
PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
|
||||
fi
|
||||
@@ -2591,7 +2592,7 @@ dnl This macro is used to get a comparable
|
||||
dnl version for apache1/2.
|
||||
dnl
|
||||
AC_DEFUN([PHP_AP_EXTRACT_VERSION],[
|
||||
ac_output=`$1 -v 2>&1 | grep version`
|
||||
ac_output=`$1 -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'`
|
||||
ac_IFS=$IFS
|
||||
IFS="- /.
|
||||
"
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ cvsclean-work:
|
||||
done
|
||||
|
||||
svnclean-work:
|
||||
@for i in `find . -type d -not -path '*/.svn/*' | grep -v '.svn'`; do \
|
||||
@for i in `find . -type d ! -path '*/.svn/*' | grep -v '.svn'`; do \
|
||||
(cd $$i 2>/dev/null && rm -rf `svn propget svn:ignore . | grep -v config.nice` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
|
||||
done
|
||||
|
||||
|
||||
+13
-6
@@ -42,14 +42,21 @@ echo "buildconf: autoconf version $ac_version found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
echo " to build PHP from SVN."
|
||||
exit 1
|
||||
else
|
||||
echo "buildconf: autoconf version $ac_version (ok)"
|
||||
fi
|
||||
|
||||
if test "$1" = "2" && test "$2" -ge "50"; then
|
||||
echo "buildconf: Your version of autoconf likely contains buggy cache code."
|
||||
echo " Running vcsclean for you."
|
||||
echo " To avoid this, install autoconf-2.13."
|
||||
if test "$1" = "2" -a "$2" -gt "59"; then
|
||||
echo "buildconf: You need autoconf 2.59 or lower to build this version of PHP."
|
||||
echo " You are currently trying to use $ac_version"
|
||||
echo " Most distros have separate autoconf 2.13 or 2.59 packages."
|
||||
echo " On Debian/Ubuntu both autoconf2.13 and autoconf2.59 packages exist."
|
||||
echo " Install autoconf2.13 and set the PHP_AUTOCONF env var to "
|
||||
echo " autoconf2.13 and try again."
|
||||
exit 1
|
||||
else
|
||||
echo "buildconf: autoconf version $ac_version (ok)"
|
||||
fi
|
||||
|
||||
if test "$1" = "2" -a "$2" -ge "50"; then
|
||||
./vcsclean
|
||||
stamp=
|
||||
fi
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ cd $srcdir
|
||||
module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`"
|
||||
|
||||
for ext in ${1+"$@"} ; do
|
||||
header_list="$header_list ext/$ext/*.h"
|
||||
header_list="$header_list ext/$ext/*.h*"
|
||||
done
|
||||
|
||||
includes=`$awk -f ./build/print_include.awk $header_list`
|
||||
|
||||
+4
-2
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=6
|
||||
PHP_EXTRA_VERSION="RC3"
|
||||
PHP_RELEASE_VERSION=7
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -1156,6 +1156,7 @@ EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR`
|
||||
EXPANDED_LOCALSTATEDIR=`eval echo $localstatedir`
|
||||
EXPANDED_BINDIR=`eval echo $bindir`
|
||||
EXPANDED_SBINDIR=`eval echo $sbindir`
|
||||
EXPANDED_MANDIR=`eval echo $mandir`
|
||||
EXPANDED_LIBDIR=$libdir
|
||||
EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
|
||||
EXPANDED_DATADIR=$datadir
|
||||
@@ -1172,6 +1173,7 @@ AC_SUBST(EXPANDED_PEAR_INSTALLDIR)
|
||||
AC_SUBST(EXPANDED_EXTENSION_DIR)
|
||||
AC_SUBST(EXPANDED_BINDIR)
|
||||
AC_SUBST(EXPANDED_SBINDIR)
|
||||
AC_SUBST(EXPANDED_MANDIR)
|
||||
AC_SUBST(EXPANDED_LIBDIR)
|
||||
AC_SUBST(EXPANDED_DATADIR)
|
||||
AC_SUBST(EXPANDED_SYSCONFDIR)
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ const zend_function_entry bcmath_functions[] = {
|
||||
PHP_FE(bcscale, arginfo_bcscale)
|
||||
PHP_FE(bccomp, arginfo_bccomp)
|
||||
PHP_FE(bcpowmod, arginfo_bcpowmod)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
zend_module_entry bcmath_module_entry = {
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ static const zend_function_entry bz2_functions[] = {
|
||||
PHP_FE(bzerror, arginfo_bzerror)
|
||||
PHP_FE(bzcompress, arginfo_bzcompress)
|
||||
PHP_FE(bzdecompress, arginfo_bzdecompress)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
zend_module_entry bz2_module_entry = {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #51997 (SEEK_CUR with 0 value, returns a warning)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$filename = "testfile.bz2";
|
||||
$str = "This is a test string.\n";
|
||||
$bz = bzopen($filename, "w");
|
||||
bzwrite($bz, $str);
|
||||
bzclose($bz);
|
||||
|
||||
$bz = bzopen($filename, "r");
|
||||
fseek($bz, 0, SEEK_CUR);
|
||||
print bzread($bz, 10);
|
||||
print bzread($bz);
|
||||
bzclose($bz);
|
||||
unlink($filename);
|
||||
|
||||
--EXPECT--
|
||||
This is a test string.
|
||||
@@ -148,7 +148,7 @@ const zend_function_entry calendar_functions[] = {
|
||||
PHP_FE(cal_from_jd, arginfo_cal_from_jd)
|
||||
PHP_FE(cal_days_in_month, arginfo_cal_days_in_month)
|
||||
PHP_FE(cal_info, arginfo_cal_info)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -129,6 +129,9 @@ static HRESULT dotnet_init(char **p_where TSRMLS_DC)
|
||||
char *where = "";
|
||||
|
||||
stuff = malloc(sizeof(*stuff));
|
||||
if (!stuff) {
|
||||
return S_FALSE;
|
||||
}
|
||||
memset(stuff, 0, sizeof(*stuff));
|
||||
|
||||
where = "CoCreateInstance";
|
||||
|
||||
@@ -228,7 +228,7 @@ const zend_function_entry com_dotnet_functions[] = {
|
||||
PHP_FE(com_message_pump, arginfo_com_message_pump)
|
||||
PHP_FE(com_load_typelib, arginfo_com_load_typelib)
|
||||
PHP_FE(com_get_active_object, arginfo_com_get_active_object)
|
||||
{ NULL, NULL, NULL }
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
/* {{{ com_dotnet_module_entry
|
||||
|
||||
@@ -697,7 +697,7 @@ static const zend_function_entry com_persist_helper_methods[] = {
|
||||
CPH_ME(InitNew, NULL)
|
||||
CPH_ME(LoadFromStream, NULL)
|
||||
CPH_ME(SaveToStream, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
static void helper_free_storage(void *obj TSRMLS_DC)
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ static const zend_function_entry ctype_functions[] = {
|
||||
PHP_FE(ctype_space, arginfo_ctype_space)
|
||||
PHP_FE(ctype_upper, arginfo_ctype_upper)
|
||||
PHP_FE(ctype_xdigit, arginfo_ctype_xdigit)
|
||||
{NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */
|
||||
PHP_FE_END
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
|
||||
+49
-2
@@ -307,7 +307,7 @@ const zend_function_entry curl_functions[] = {
|
||||
PHP_FE(curl_multi_getcontent, arginfo_curl_multi_getcontent)
|
||||
PHP_FE(curl_multi_info_read, arginfo_curl_multi_info_read)
|
||||
PHP_FE(curl_multi_close, arginfo_curl_multi_close)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -331,6 +331,13 @@ zend_module_entry curl_module_entry = {
|
||||
ZEND_GET_MODULE (curl)
|
||||
#endif
|
||||
|
||||
/* {{{ PHP_INI_BEGIN */
|
||||
PHP_INI_BEGIN()
|
||||
PHP_INI_ENTRY("curl.cainfo", "", PHP_INI_SYSTEM, NULL)
|
||||
PHP_INI_END()
|
||||
/* }}} */
|
||||
|
||||
/* }}} */
|
||||
/* {{{ PHP_MINFO_FUNCTION
|
||||
*/
|
||||
PHP_MINFO_FUNCTION(curl)
|
||||
@@ -458,6 +465,8 @@ PHP_MINIT_FUNCTION(curl)
|
||||
le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number);
|
||||
le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, "curl_multi", module_number);
|
||||
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
/* See http://curl.haxx.se/lxr/source/docs/libcurl/symbols-in-versions
|
||||
or curl src/docs/libcurl/symbols-in-versions for a (almost) complete list
|
||||
of options and which version they were introduced */
|
||||
@@ -581,6 +590,11 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFUNMODSINCE);
|
||||
REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD);
|
||||
|
||||
#if LIBCURL_VERSION_NUM > 0x070f04 /* CURLOPT_MAX_RECV_SPEED_LARGE & CURLOPT_MAX_SEND_SPEED_LARGE are available since curl 7.15.5 */
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_MAX_RECV_SPEED_LARGE);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_MAX_SEND_SPEED_LARGE);
|
||||
#endif
|
||||
|
||||
#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH);
|
||||
/* http authentication options */
|
||||
@@ -632,6 +646,10 @@ PHP_MINIT_FUNCTION(curl)
|
||||
#if LIBCURL_VERSION_NUM > 0x071301
|
||||
REGISTER_CURL_CONSTANT(CURLINFO_CERTINFO);
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071202
|
||||
REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL);
|
||||
#endif
|
||||
|
||||
|
||||
/* cURL protocol constants (curl_version) */
|
||||
REGISTER_CURL_CONSTANT(CURL_VERSION_IPV6);
|
||||
@@ -803,6 +821,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
int i, c = CRYPTO_num_locks();
|
||||
|
||||
php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));
|
||||
if (!php_curl_openssl_tsl) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
for (i = 0; i < c; ++i) {
|
||||
php_curl_openssl_tsl[i] = tsrm_mutex_alloc();
|
||||
@@ -879,6 +900,7 @@ PHP_MSHUTDOWN_FUNCTION(curl)
|
||||
php_curl_openssl_tsl = NULL;
|
||||
}
|
||||
#endif
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1427,6 +1449,7 @@ PHP_FUNCTION(curl_init)
|
||||
zval *clone;
|
||||
char *url = NULL;
|
||||
int url_len = 0;
|
||||
char *cainfo;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &url, &url_len) == FAILURE) {
|
||||
return;
|
||||
@@ -1453,6 +1476,8 @@ PHP_FUNCTION(curl_init)
|
||||
MAKE_STD_ZVAL(clone);
|
||||
ch->clone = clone;
|
||||
|
||||
|
||||
|
||||
curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str);
|
||||
@@ -1465,6 +1490,12 @@ PHP_FUNCTION(curl_init)
|
||||
curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
|
||||
|
||||
cainfo = INI_STR("curl.cainfo");
|
||||
if (cainfo && strlen(cainfo) > 0) {
|
||||
curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo);
|
||||
}
|
||||
|
||||
#if defined(ZTS)
|
||||
curl_easy_setopt(ch->cp, CURLOPT_NOSIGNAL, 1);
|
||||
#endif
|
||||
@@ -1669,6 +1700,13 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
#endif
|
||||
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
|
||||
break;
|
||||
#if LIBCURL_VERSION_NUM > 0x070f04
|
||||
case CURLOPT_MAX_RECV_SPEED_LARGE:
|
||||
case CURLOPT_MAX_SEND_SPEED_LARGE:
|
||||
convert_to_long_ex(zvalue);
|
||||
error = curl_easy_setopt(ch->cp, option, (curl_off_t)Z_LVAL_PP(zvalue));
|
||||
break;
|
||||
#endif
|
||||
case CURLOPT_FOLLOWLOCATION:
|
||||
convert_to_long_ex(zvalue);
|
||||
if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
|
||||
@@ -2305,6 +2343,11 @@ PHP_FUNCTION(curl_getinfo)
|
||||
create_certinfo(ci, listcode TSRMLS_CC);
|
||||
CAAZ("certinfo", listcode);
|
||||
}
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x071202
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_URL, &s_code) == CURLE_OK) {
|
||||
CAAS("redirect_url", s_code);
|
||||
}
|
||||
#endif
|
||||
if (ch->header.str_len > 0) {
|
||||
CAAS("request_header", ch->header.str);
|
||||
@@ -2313,7 +2356,11 @@ PHP_FUNCTION(curl_getinfo)
|
||||
switch (option) {
|
||||
case CURLINFO_PRIVATE:
|
||||
case CURLINFO_EFFECTIVE_URL:
|
||||
case CURLINFO_CONTENT_TYPE: {
|
||||
case CURLINFO_CONTENT_TYPE:
|
||||
#if LIBCURL_VERSION_NUM >= 0x071202
|
||||
case CURLINFO_REDIRECT_URL:
|
||||
#endif
|
||||
{
|
||||
char *s_code = NULL;
|
||||
|
||||
if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) {
|
||||
|
||||
@@ -18,7 +18,7 @@ $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
if(!empty($host)) {
|
||||
|
||||
// Use the set Environment variable
|
||||
$url = "$host/get.php";
|
||||
$url = "$host/get.php?test=1";
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -25,6 +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_time one_backup, two_backup;
|
||||
|
||||
rt = timelib_rel_time_ctor();
|
||||
rt->invert = 0;
|
||||
@@ -45,6 +46,10 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
dst_m_corr = ((two->z - one->z) % 3600) / 60;
|
||||
}
|
||||
|
||||
/* Save old TZ info */
|
||||
memcpy(&one_backup, one, sizeof(one_backup));
|
||||
memcpy(&two_backup, two, sizeof(two_backup));
|
||||
|
||||
timelib_apply_localtime(one, 0);
|
||||
timelib_apply_localtime(two, 0);
|
||||
|
||||
@@ -58,8 +63,9 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
|
||||
timelib_do_rel_normalize(rt->invert ? one : two, rt);
|
||||
|
||||
timelib_apply_localtime(one, 1);
|
||||
timelib_apply_localtime(two, 1);
|
||||
/* Restore old TZ info */
|
||||
memcpy(one, &one_backup, sizeof(one_backup));
|
||||
memcpy(two, &two_backup, sizeof(two_backup));
|
||||
|
||||
return rt;
|
||||
}
|
||||
+159
-113
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sat Nov 13 14:58:02 2010 */
|
||||
/* Generated by re2c 0.13.5 on Sun Jun 5 15:26:42 2011 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
@@ -720,6 +721,25 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
|
||||
if (!first_found) {
|
||||
first_found = 1;
|
||||
first_found_elem = tp;
|
||||
if (gmtoffset == -1) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
if (tp->gmtoffset == gmtoffset) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (first_found) {
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
|
||||
/* Still didn't find anything, let's find the zone solely based on
|
||||
* offset/isdst then */
|
||||
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
|
||||
@@ -843,11 +863,11 @@ static int scan(Scanner *s)
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 969 "ext/date/lib/parse_date.re"
|
||||
#line 989 "ext/date/lib/parse_date.re"
|
||||
|
||||
|
||||
|
||||
#line 851 "ext/date/lib/parse_date.c"
|
||||
#line 871 "ext/date/lib/parse_date.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -967,7 +987,7 @@ std:
|
||||
}
|
||||
yy2:
|
||||
YYDEBUG(2, *YYCURSOR);
|
||||
#line 1054 "ext/date/lib/parse_date.re"
|
||||
#line 1074 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
@@ -983,7 +1003,7 @@ yy2:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 987 "ext/date/lib/parse_date.c"
|
||||
#line 1007 "ext/date/lib/parse_date.c"
|
||||
yy3:
|
||||
YYDEBUG(3, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1006,7 +1026,7 @@ yy3:
|
||||
}
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
#line 1636 "ext/date/lib/parse_date.re"
|
||||
#line 1656 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
@@ -1019,7 +1039,7 @@ yy4:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIMEZONE;
|
||||
}
|
||||
#line 1023 "ext/date/lib/parse_date.c"
|
||||
#line 1043 "ext/date/lib/parse_date.c"
|
||||
yy5:
|
||||
YYDEBUG(5, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1330,12 +1350,12 @@ yy12:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
#line 1731 "ext/date/lib/parse_date.re"
|
||||
#line 1751 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 1339 "ext/date/lib/parse_date.c"
|
||||
#line 1359 "ext/date/lib/parse_date.c"
|
||||
yy14:
|
||||
YYDEBUG(14, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2392,11 +2412,11 @@ yy49:
|
||||
if (yych <= '9') goto yy55;
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
#line 1720 "ext/date/lib/parse_date.re"
|
||||
#line 1740 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 2400 "ext/date/lib/parse_date.c"
|
||||
#line 2420 "ext/date/lib/parse_date.c"
|
||||
yy51:
|
||||
YYDEBUG(51, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2405,12 +2425,12 @@ yy52:
|
||||
YYDEBUG(52, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
#line 1725 "ext/date/lib/parse_date.re"
|
||||
#line 1745 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 2414 "ext/date/lib/parse_date.c"
|
||||
#line 2434 "ext/date/lib/parse_date.c"
|
||||
yy54:
|
||||
YYDEBUG(54, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2797,7 +2817,7 @@ yy72:
|
||||
if (yych == 's') goto yy74;
|
||||
yy73:
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
#line 1704 "ext/date/lib/parse_date.re"
|
||||
#line 1724 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
@@ -2812,7 +2832,7 @@ yy73:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 2816 "ext/date/lib/parse_date.c"
|
||||
#line 2836 "ext/date/lib/parse_date.c"
|
||||
yy74:
|
||||
YYDEBUG(74, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -3574,7 +3594,7 @@ yy166:
|
||||
}
|
||||
yy167:
|
||||
YYDEBUG(167, *YYCURSOR);
|
||||
#line 1567 "ext/date/lib/parse_date.re"
|
||||
#line 1587 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
@@ -3591,7 +3611,7 @@ yy167:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
#line 3595 "ext/date/lib/parse_date.c"
|
||||
#line 3615 "ext/date/lib/parse_date.c"
|
||||
yy168:
|
||||
YYDEBUG(168, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4111,7 +4131,7 @@ yy193:
|
||||
}
|
||||
yy194:
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
#line 1626 "ext/date/lib/parse_date.re"
|
||||
#line 1646 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
@@ -4120,7 +4140,7 @@ yy194:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4124 "ext/date/lib/parse_date.c"
|
||||
#line 4144 "ext/date/lib/parse_date.c"
|
||||
yy195:
|
||||
YYDEBUG(195, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -4171,7 +4191,7 @@ yy198:
|
||||
}
|
||||
yy199:
|
||||
YYDEBUG(199, *YYCURSOR);
|
||||
#line 1376 "ext/date/lib/parse_date.re"
|
||||
#line 1396 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
TIMELIB_INIT;
|
||||
@@ -4183,7 +4203,7 @@ yy199:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4187 "ext/date/lib/parse_date.c"
|
||||
#line 4207 "ext/date/lib/parse_date.c"
|
||||
yy200:
|
||||
YYDEBUG(200, *YYCURSOR);
|
||||
yyaccept = 6;
|
||||
@@ -4452,7 +4472,7 @@ yy222:
|
||||
}
|
||||
yy223:
|
||||
YYDEBUG(223, *YYCURSOR);
|
||||
#line 1674 "ext/date/lib/parse_date.re"
|
||||
#line 1694 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
@@ -4481,7 +4501,7 @@ yy223:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4485 "ext/date/lib/parse_date.c"
|
||||
#line 4505 "ext/date/lib/parse_date.c"
|
||||
yy224:
|
||||
YYDEBUG(224, *YYCURSOR);
|
||||
yyaccept = 7;
|
||||
@@ -5179,7 +5199,7 @@ yy278:
|
||||
YYDEBUG(278, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(279, *YYCURSOR);
|
||||
#line 1650 "ext/date/lib/parse_date.re"
|
||||
#line 1670 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -5202,7 +5222,7 @@ yy278:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 5206 "ext/date/lib/parse_date.c"
|
||||
#line 5226 "ext/date/lib/parse_date.c"
|
||||
yy280:
|
||||
YYDEBUG(280, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5380,7 +5400,7 @@ yy294:
|
||||
++YYCURSOR;
|
||||
yy295:
|
||||
YYDEBUG(295, *YYCURSOR);
|
||||
#line 1350 "ext/date/lib/parse_date.re"
|
||||
#line 1370 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
TIMELIB_INIT;
|
||||
@@ -5392,7 +5412,7 @@ yy295:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 5396 "ext/date/lib/parse_date.c"
|
||||
#line 5416 "ext/date/lib/parse_date.c"
|
||||
yy296:
|
||||
YYDEBUG(296, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6612,7 +6632,7 @@ yy362:
|
||||
if (yych <= '9') goto yy365;
|
||||
yy364:
|
||||
YYDEBUG(364, *YYCURSOR);
|
||||
#line 1490 "ext/date/lib/parse_date.re"
|
||||
#line 1510 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
TIMELIB_INIT;
|
||||
@@ -6624,7 +6644,7 @@ yy364:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 6628 "ext/date/lib/parse_date.c"
|
||||
#line 6648 "ext/date/lib/parse_date.c"
|
||||
yy365:
|
||||
YYDEBUG(365, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7262,7 +7282,7 @@ yy392:
|
||||
}
|
||||
yy393:
|
||||
YYDEBUG(393, *YYCURSOR);
|
||||
#line 1546 "ext/date/lib/parse_date.re"
|
||||
#line 1566 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
@@ -7282,7 +7302,7 @@ yy393:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AGO;
|
||||
}
|
||||
#line 7286 "ext/date/lib/parse_date.c"
|
||||
#line 7306 "ext/date/lib/parse_date.c"
|
||||
yy394:
|
||||
YYDEBUG(394, *YYCURSOR);
|
||||
yyaccept = 5;
|
||||
@@ -9032,7 +9052,7 @@ yy454:
|
||||
++YYCURSOR;
|
||||
yy455:
|
||||
YYDEBUG(455, *YYCURSOR);
|
||||
#line 1260 "ext/date/lib/parse_date.re"
|
||||
#line 1280 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
@@ -9043,7 +9063,7 @@ yy455:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 9047 "ext/date/lib/parse_date.c"
|
||||
#line 9067 "ext/date/lib/parse_date.c"
|
||||
yy456:
|
||||
YYDEBUG(456, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -9603,7 +9623,7 @@ yy475:
|
||||
}
|
||||
yy476:
|
||||
YYDEBUG(476, *YYCURSOR);
|
||||
#line 1389 "ext/date/lib/parse_date.re"
|
||||
#line 1409 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -9614,7 +9634,7 @@ yy476:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 9618 "ext/date/lib/parse_date.c"
|
||||
#line 9638 "ext/date/lib/parse_date.c"
|
||||
yy477:
|
||||
YYDEBUG(477, *YYCURSOR);
|
||||
yyaccept = 10;
|
||||
@@ -9755,7 +9775,7 @@ yy488:
|
||||
YYDEBUG(488, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(489, *YYCURSOR);
|
||||
#line 1116 "ext/date/lib/parse_date.re"
|
||||
#line 1136 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -9771,7 +9791,7 @@ yy488:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME12;
|
||||
}
|
||||
#line 9775 "ext/date/lib/parse_date.c"
|
||||
#line 9795 "ext/date/lib/parse_date.c"
|
||||
yy490:
|
||||
YYDEBUG(490, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -9784,7 +9804,7 @@ yy490:
|
||||
}
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
#line 1153 "ext/date/lib/parse_date.re"
|
||||
#line 1173 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
@@ -9809,7 +9829,7 @@ yy491:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9813 "ext/date/lib/parse_date.c"
|
||||
#line 9833 "ext/date/lib/parse_date.c"
|
||||
yy492:
|
||||
YYDEBUG(492, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10119,7 +10139,7 @@ yy523:
|
||||
YYDEBUG(523, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(524, *YYCURSOR);
|
||||
#line 1133 "ext/date/lib/parse_date.re"
|
||||
#line 1153 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
@@ -10138,7 +10158,7 @@ yy523:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 10142 "ext/date/lib/parse_date.c"
|
||||
#line 10162 "ext/date/lib/parse_date.c"
|
||||
yy525:
|
||||
YYDEBUG(525, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10244,7 +10264,7 @@ yy534:
|
||||
if (yych <= '9') goto yy541;
|
||||
yy535:
|
||||
YYDEBUG(535, *YYCURSOR);
|
||||
#line 1311 "ext/date/lib/parse_date.re"
|
||||
#line 1331 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datefull");
|
||||
TIMELIB_INIT;
|
||||
@@ -10257,7 +10277,7 @@ yy535:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
#line 10261 "ext/date/lib/parse_date.c"
|
||||
#line 10281 "ext/date/lib/parse_date.c"
|
||||
yy536:
|
||||
YYDEBUG(536, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -10994,7 +11014,7 @@ yy605:
|
||||
YYDEBUG(606, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(607, *YYCURSOR);
|
||||
#line 1325 "ext/date/lib/parse_date.re"
|
||||
#line 1345 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
@@ -11005,7 +11025,7 @@ yy605:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11009 "ext/date/lib/parse_date.c"
|
||||
#line 11029 "ext/date/lib/parse_date.c"
|
||||
yy608:
|
||||
YYDEBUG(608, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11041,7 +11061,7 @@ yy611:
|
||||
if (yych <= '9') goto yy605;
|
||||
yy612:
|
||||
YYDEBUG(612, *YYCURSOR);
|
||||
#line 1337 "ext/date/lib/parse_date.re"
|
||||
#line 1357 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
TIMELIB_INIT;
|
||||
@@ -11053,7 +11073,7 @@ yy612:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11057 "ext/date/lib/parse_date.c"
|
||||
#line 11077 "ext/date/lib/parse_date.c"
|
||||
yy613:
|
||||
YYDEBUG(613, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11694,7 +11714,7 @@ yy656:
|
||||
}
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
#line 1298 "ext/date/lib/parse_date.re"
|
||||
#line 1318 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
TIMELIB_INIT;
|
||||
@@ -11706,7 +11726,7 @@ yy657:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11710 "ext/date/lib/parse_date.c"
|
||||
#line 11730 "ext/date/lib/parse_date.c"
|
||||
yy658:
|
||||
YYDEBUG(658, *YYCURSOR);
|
||||
yyaccept = 13;
|
||||
@@ -11812,7 +11832,7 @@ yy666:
|
||||
}
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
#line 1245 "ext/date/lib/parse_date.re"
|
||||
#line 1265 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
TIMELIB_INIT;
|
||||
@@ -11826,7 +11846,7 @@ yy667:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
}
|
||||
#line 11830 "ext/date/lib/parse_date.c"
|
||||
#line 11850 "ext/date/lib/parse_date.c"
|
||||
yy668:
|
||||
YYDEBUG(668, *YYCURSOR);
|
||||
yyaccept = 14;
|
||||
@@ -12059,7 +12079,7 @@ yy700:
|
||||
if (yych <= ':') goto yy704;
|
||||
yy701:
|
||||
YYDEBUG(701, *YYCURSOR);
|
||||
#line 1516 "ext/date/lib/parse_date.re"
|
||||
#line 1536 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
@@ -12079,7 +12099,7 @@ yy701:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12083 "ext/date/lib/parse_date.c"
|
||||
#line 12103 "ext/date/lib/parse_date.c"
|
||||
yy702:
|
||||
YYDEBUG(702, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12631,7 +12651,7 @@ yy763:
|
||||
}
|
||||
yy764:
|
||||
YYDEBUG(764, *YYCURSOR);
|
||||
#line 1272 "ext/date/lib/parse_date.re"
|
||||
#line 1292 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
TIMELIB_INIT;
|
||||
@@ -12643,7 +12663,7 @@ yy764:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 12647 "ext/date/lib/parse_date.c"
|
||||
#line 12667 "ext/date/lib/parse_date.c"
|
||||
yy765:
|
||||
YYDEBUG(765, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12682,7 +12702,7 @@ yy771:
|
||||
YYDEBUG(771, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
#line 1503 "ext/date/lib/parse_date.re"
|
||||
#line 1523 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
TIMELIB_INIT;
|
||||
@@ -12694,7 +12714,7 @@ yy771:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 12698 "ext/date/lib/parse_date.c"
|
||||
#line 12718 "ext/date/lib/parse_date.c"
|
||||
yy773:
|
||||
YYDEBUG(773, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12832,7 +12852,7 @@ yy783:
|
||||
}
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
#line 1537 "ext/date/lib/parse_date.re"
|
||||
#line 1557 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
@@ -12840,7 +12860,7 @@ yy784:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12844 "ext/date/lib/parse_date.c"
|
||||
#line 12864 "ext/date/lib/parse_date.c"
|
||||
yy785:
|
||||
YYDEBUG(785, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12991,7 +13011,7 @@ yy793:
|
||||
}
|
||||
yy794:
|
||||
YYDEBUG(794, *YYCURSOR);
|
||||
#line 1363 "ext/date/lib/parse_date.re"
|
||||
#line 1383 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -13003,7 +13023,7 @@ yy794:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 13007 "ext/date/lib/parse_date.c"
|
||||
#line 13027 "ext/date/lib/parse_date.c"
|
||||
yy795:
|
||||
YYDEBUG(795, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13218,7 +13238,7 @@ yy814:
|
||||
if (yych <= '7') goto yy817;
|
||||
yy815:
|
||||
YYDEBUG(815, *YYCURSOR);
|
||||
#line 1471 "ext/date/lib/parse_date.re"
|
||||
#line 1491 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
@@ -13236,7 +13256,7 @@ yy815:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13240 "ext/date/lib/parse_date.c"
|
||||
#line 13260 "ext/date/lib/parse_date.c"
|
||||
yy816:
|
||||
YYDEBUG(816, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13246,7 +13266,7 @@ yy817:
|
||||
YYDEBUG(817, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(818, *YYCURSOR);
|
||||
#line 1452 "ext/date/lib/parse_date.re"
|
||||
#line 1472 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
@@ -13264,7 +13284,7 @@ yy817:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13268 "ext/date/lib/parse_date.c"
|
||||
#line 13288 "ext/date/lib/parse_date.c"
|
||||
yy819:
|
||||
YYDEBUG(819, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13328,7 +13348,7 @@ yy821:
|
||||
}
|
||||
yy822:
|
||||
YYDEBUG(822, *YYCURSOR);
|
||||
#line 1439 "ext/date/lib/parse_date.re"
|
||||
#line 1459 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
TIMELIB_INIT;
|
||||
@@ -13340,7 +13360,7 @@ yy822:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
#line 13344 "ext/date/lib/parse_date.c"
|
||||
#line 13364 "ext/date/lib/parse_date.c"
|
||||
yy823:
|
||||
YYDEBUG(823, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13443,7 +13463,7 @@ yy842:
|
||||
++YYCURSOR;
|
||||
yy843:
|
||||
YYDEBUG(843, *YYCURSOR);
|
||||
#line 1413 "ext/date/lib/parse_date.re"
|
||||
#line 1433 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
@@ -13468,7 +13488,7 @@ yy843:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_XMLRPC_SOAP;
|
||||
}
|
||||
#line 13472 "ext/date/lib/parse_date.c"
|
||||
#line 13492 "ext/date/lib/parse_date.c"
|
||||
yy844:
|
||||
YYDEBUG(844, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13730,7 +13750,7 @@ yy848:
|
||||
}
|
||||
yy849:
|
||||
YYDEBUG(849, *YYCURSOR);
|
||||
#line 1401 "ext/date/lib/parse_date.re"
|
||||
#line 1421 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -13741,7 +13761,7 @@ yy849:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NOCOLON;
|
||||
}
|
||||
#line 13745 "ext/date/lib/parse_date.c"
|
||||
#line 13765 "ext/date/lib/parse_date.c"
|
||||
yy850:
|
||||
YYDEBUG(850, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -14661,7 +14681,7 @@ yy973:
|
||||
if (yych <= '9') goto yy996;
|
||||
yy974:
|
||||
YYDEBUG(974, *YYCURSOR);
|
||||
#line 1285 "ext/date/lib/parse_date.re"
|
||||
#line 1305 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
TIMELIB_INIT;
|
||||
@@ -14673,7 +14693,7 @@ yy974:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 14677 "ext/date/lib/parse_date.c"
|
||||
#line 14697 "ext/date/lib/parse_date.c"
|
||||
yy975:
|
||||
YYDEBUG(975, *YYCURSOR);
|
||||
yyaccept = 22;
|
||||
@@ -15682,7 +15702,7 @@ yy1066:
|
||||
}
|
||||
yy1068:
|
||||
YYDEBUG(1068, *YYCURSOR);
|
||||
#line 1179 "ext/date/lib/parse_date.re"
|
||||
#line 1199 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -15704,7 +15724,7 @@ yy1068:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_GNU_NOCOLON;
|
||||
}
|
||||
#line 15708 "ext/date/lib/parse_date.c"
|
||||
#line 15728 "ext/date/lib/parse_date.c"
|
||||
yy1069:
|
||||
YYDEBUG(1069, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -15796,7 +15816,7 @@ yy1075:
|
||||
}
|
||||
yy1076:
|
||||
YYDEBUG(1076, *YYCURSOR);
|
||||
#line 1225 "ext/date/lib/parse_date.re"
|
||||
#line 1245 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
@@ -15815,7 +15835,7 @@ yy1076:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_NOCOLON;
|
||||
}
|
||||
#line 15819 "ext/date/lib/parse_date.c"
|
||||
#line 15839 "ext/date/lib/parse_date.c"
|
||||
yy1077:
|
||||
YYDEBUG(1077, *YYCURSOR);
|
||||
yyaccept = 25;
|
||||
@@ -16713,7 +16733,7 @@ yy1117:
|
||||
}
|
||||
yy1118:
|
||||
YYDEBUG(1118, *YYCURSOR);
|
||||
#line 1609 "ext/date/lib/parse_date.re"
|
||||
#line 1629 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16729,7 +16749,7 @@ yy1118:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16733 "ext/date/lib/parse_date.c"
|
||||
#line 16753 "ext/date/lib/parse_date.c"
|
||||
yy1119:
|
||||
YYDEBUG(1119, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -16780,7 +16800,7 @@ yy1126:
|
||||
YYDEBUG(1126, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1127, *YYCURSOR);
|
||||
#line 1094 "ext/date/lib/parse_date.re"
|
||||
#line 1114 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16801,7 +16821,7 @@ yy1126:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEK_DAY_OF_MONTH;
|
||||
}
|
||||
#line 16805 "ext/date/lib/parse_date.c"
|
||||
#line 16825 "ext/date/lib/parse_date.c"
|
||||
yy1128:
|
||||
YYDEBUG(1128, *YYCURSOR);
|
||||
yyaccept = 26;
|
||||
@@ -16909,7 +16929,7 @@ yy1141:
|
||||
}
|
||||
yy1142:
|
||||
YYDEBUG(1142, *YYCURSOR);
|
||||
#line 1585 "ext/date/lib/parse_date.re"
|
||||
#line 1605 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16932,7 +16952,7 @@ yy1142:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16936 "ext/date/lib/parse_date.c"
|
||||
#line 16956 "ext/date/lib/parse_date.c"
|
||||
yy1143:
|
||||
YYDEBUG(1143, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -19609,7 +19629,7 @@ yy1294:
|
||||
goto yy1298;
|
||||
yy1295:
|
||||
YYDEBUG(1295, *YYCURSOR);
|
||||
#line 1071 "ext/date/lib/parse_date.re"
|
||||
#line 1091 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
@@ -19631,7 +19651,7 @@ yy1295:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19635 "ext/date/lib/parse_date.c"
|
||||
#line 19655 "ext/date/lib/parse_date.c"
|
||||
yy1296:
|
||||
YYDEBUG(1296, *YYCURSOR);
|
||||
yyaccept = 28;
|
||||
@@ -21322,7 +21342,7 @@ yy1385:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy1387:
|
||||
YYDEBUG(1387, *YYCURSOR);
|
||||
#line 1029 "ext/date/lib/parse_date.re"
|
||||
#line 1049 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
|
||||
@@ -21346,7 +21366,7 @@ yy1387:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21350 "ext/date/lib/parse_date.c"
|
||||
#line 21370 "ext/date/lib/parse_date.c"
|
||||
yy1388:
|
||||
YYDEBUG(1388, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21782,7 +21802,7 @@ yy1416:
|
||||
++YYCURSOR;
|
||||
yy1417:
|
||||
YYDEBUG(1417, *YYCURSOR);
|
||||
#line 1017 "ext/date/lib/parse_date.re"
|
||||
#line 1037 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("tomorrow");
|
||||
TIMELIB_INIT;
|
||||
@@ -21793,7 +21813,7 @@ yy1417:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21797 "ext/date/lib/parse_date.c"
|
||||
#line 21817 "ext/date/lib/parse_date.c"
|
||||
yy1418:
|
||||
YYDEBUG(1418, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21828,7 +21848,7 @@ yy1419:
|
||||
}
|
||||
yy1420:
|
||||
YYDEBUG(1420, *YYCURSOR);
|
||||
#line 1007 "ext/date/lib/parse_date.re"
|
||||
#line 1027 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("midnight | today");
|
||||
TIMELIB_INIT;
|
||||
@@ -21837,7 +21857,7 @@ yy1420:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21841 "ext/date/lib/parse_date.c"
|
||||
#line 21861 "ext/date/lib/parse_date.c"
|
||||
yy1421:
|
||||
YYDEBUG(1421, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23849,7 +23869,7 @@ yy1499:
|
||||
}
|
||||
yy1500:
|
||||
YYDEBUG(1500, *YYCURSOR);
|
||||
#line 986 "ext/date/lib/parse_date.re"
|
||||
#line 1006 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("now");
|
||||
TIMELIB_INIT;
|
||||
@@ -23857,7 +23877,7 @@ yy1500:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23861 "ext/date/lib/parse_date.c"
|
||||
#line 23881 "ext/date/lib/parse_date.c"
|
||||
yy1501:
|
||||
YYDEBUG(1501, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23996,7 +24016,7 @@ yy1507:
|
||||
}
|
||||
yy1508:
|
||||
YYDEBUG(1508, *YYCURSOR);
|
||||
#line 995 "ext/date/lib/parse_date.re"
|
||||
#line 1015 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("noon");
|
||||
TIMELIB_INIT;
|
||||
@@ -24007,7 +24027,7 @@ yy1508:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24011 "ext/date/lib/parse_date.c"
|
||||
#line 24031 "ext/date/lib/parse_date.c"
|
||||
yy1509:
|
||||
YYDEBUG(1509, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24540,7 +24560,7 @@ yy1530:
|
||||
++YYCURSOR;
|
||||
yy1531:
|
||||
YYDEBUG(1531, *YYCURSOR);
|
||||
#line 974 "ext/date/lib/parse_date.re"
|
||||
#line 994 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("yesterday");
|
||||
TIMELIB_INIT;
|
||||
@@ -24551,7 +24571,7 @@ yy1531:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24555 "ext/date/lib/parse_date.c"
|
||||
#line 24575 "ext/date/lib/parse_date.c"
|
||||
yy1532:
|
||||
YYDEBUG(1532, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24724,7 +24744,7 @@ yy1537:
|
||||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1735 "ext/date/lib/parse_date.re"
|
||||
#line 1755 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
@@ -24815,6 +24835,30 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
|
||||
add_pbf_error(s, "Unexpected data found.", string, begin); \
|
||||
}
|
||||
|
||||
static void timelib_time_reset_fields(timelib_time *time)
|
||||
{
|
||||
assert(time != NULL);
|
||||
|
||||
time->y = 1970;
|
||||
time->m = 1;
|
||||
time->d = 1;
|
||||
time->h = time->i = time->s = 0;
|
||||
time->f = 0.0;
|
||||
time->tz_info = NULL;
|
||||
}
|
||||
|
||||
static void timelib_time_reset_unset_fields(timelib_time *time)
|
||||
{
|
||||
assert(time != NULL);
|
||||
|
||||
if (time->y == TIMELIB_UNSET ) time->y = 1970;
|
||||
if (time->m == TIMELIB_UNSET ) time->m = 1;
|
||||
if (time->d == TIMELIB_UNSET ) time->d = 1;
|
||||
if (time->h == TIMELIB_UNSET ) time->h = 0;
|
||||
if (time->i == TIMELIB_UNSET ) time->i = 0;
|
||||
if (time->s == TIMELIB_UNSET ) time->s = 0;
|
||||
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
|
||||
}
|
||||
|
||||
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb)
|
||||
{
|
||||
@@ -25013,23 +25057,11 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
break;
|
||||
|
||||
case '!': /* reset all fields to default */
|
||||
s->time->y = 1970;
|
||||
s->time->m = 1;
|
||||
s->time->d = 1;
|
||||
s->time->h = s->time->i = s->time->s = 0;
|
||||
s->time->f = 0.0;
|
||||
s->time->tz_info = NULL;
|
||||
timelib_time_reset_fields(s->time);
|
||||
break; /* break intentionally not missing */
|
||||
|
||||
case '|': /* reset all fields to default when not set */
|
||||
if (s->time->y == TIMELIB_UNSET ) s->time->y = 1970;
|
||||
if (s->time->m == TIMELIB_UNSET ) s->time->m = 1;
|
||||
if (s->time->d == TIMELIB_UNSET ) s->time->d = 1;
|
||||
if (s->time->h == TIMELIB_UNSET ) s->time->h = 0;
|
||||
if (s->time->i == TIMELIB_UNSET ) s->time->i = 0;
|
||||
if (s->time->s == TIMELIB_UNSET ) s->time->s = 0;
|
||||
if (s->time->f == TIMELIB_UNSET ) s->time->f = 0.0;
|
||||
|
||||
timelib_time_reset_unset_fields(s->time);
|
||||
break; /* break intentionally not missing */
|
||||
|
||||
case '?': /* random char */
|
||||
@@ -25061,7 +25093,21 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
add_pbf_error(s, "Trailing data", string, ptr);
|
||||
}
|
||||
if (*fptr) {
|
||||
add_pbf_error(s, "Data missing", string, ptr);
|
||||
/* Trailing | and ! specifiers are valid. */
|
||||
while (*fptr) {
|
||||
switch (*fptr++) {
|
||||
case '!': /* reset all fields to default */
|
||||
timelib_time_reset_fields(s->time);
|
||||
break;
|
||||
|
||||
case '|': /* reset all fields to default when not set */
|
||||
timelib_time_reset_unset_fields(s->time);
|
||||
break;
|
||||
|
||||
default:
|
||||
add_pbf_error(s, "Data missing", string, ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* clean up a bit */
|
||||
|
||||
+61
-15
@@ -23,6 +23,7 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
@@ -718,6 +719,25 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
|
||||
if (!first_found) {
|
||||
first_found = 1;
|
||||
first_found_elem = tp;
|
||||
if (gmtoffset == -1) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
if (tp->gmtoffset == gmtoffset) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (first_found) {
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
|
||||
/* Still didn't find anything, let's find the zone solely based on
|
||||
* offset/isdst then */
|
||||
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
|
||||
@@ -1822,6 +1842,30 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
|
||||
add_pbf_error(s, "Unexpected data found.", string, begin); \
|
||||
}
|
||||
|
||||
static void timelib_time_reset_fields(timelib_time *time)
|
||||
{
|
||||
assert(time != NULL);
|
||||
|
||||
time->y = 1970;
|
||||
time->m = 1;
|
||||
time->d = 1;
|
||||
time->h = time->i = time->s = 0;
|
||||
time->f = 0.0;
|
||||
time->tz_info = NULL;
|
||||
}
|
||||
|
||||
static void timelib_time_reset_unset_fields(timelib_time *time)
|
||||
{
|
||||
assert(time != NULL);
|
||||
|
||||
if (time->y == TIMELIB_UNSET ) time->y = 1970;
|
||||
if (time->m == TIMELIB_UNSET ) time->m = 1;
|
||||
if (time->d == TIMELIB_UNSET ) time->d = 1;
|
||||
if (time->h == TIMELIB_UNSET ) time->h = 0;
|
||||
if (time->i == TIMELIB_UNSET ) time->i = 0;
|
||||
if (time->s == TIMELIB_UNSET ) time->s = 0;
|
||||
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
|
||||
}
|
||||
|
||||
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb)
|
||||
{
|
||||
@@ -2020,23 +2064,11 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
break;
|
||||
|
||||
case '!': /* reset all fields to default */
|
||||
s->time->y = 1970;
|
||||
s->time->m = 1;
|
||||
s->time->d = 1;
|
||||
s->time->h = s->time->i = s->time->s = 0;
|
||||
s->time->f = 0.0;
|
||||
s->time->tz_info = NULL;
|
||||
timelib_time_reset_fields(s->time);
|
||||
break; /* break intentionally not missing */
|
||||
|
||||
case '|': /* reset all fields to default when not set */
|
||||
if (s->time->y == TIMELIB_UNSET ) s->time->y = 1970;
|
||||
if (s->time->m == TIMELIB_UNSET ) s->time->m = 1;
|
||||
if (s->time->d == TIMELIB_UNSET ) s->time->d = 1;
|
||||
if (s->time->h == TIMELIB_UNSET ) s->time->h = 0;
|
||||
if (s->time->i == TIMELIB_UNSET ) s->time->i = 0;
|
||||
if (s->time->s == TIMELIB_UNSET ) s->time->s = 0;
|
||||
if (s->time->f == TIMELIB_UNSET ) s->time->f = 0.0;
|
||||
|
||||
timelib_time_reset_unset_fields(s->time);
|
||||
break; /* break intentionally not missing */
|
||||
|
||||
case '?': /* random char */
|
||||
@@ -2068,7 +2100,21 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
add_pbf_error(s, "Trailing data", string, ptr);
|
||||
}
|
||||
if (*fptr) {
|
||||
add_pbf_error(s, "Data missing", string, ptr);
|
||||
/* Trailing | and ! specifiers are valid. */
|
||||
while (*fptr) {
|
||||
switch (*fptr++) {
|
||||
case '!': /* reset all fields to default */
|
||||
timelib_time_reset_fields(s->time);
|
||||
break;
|
||||
|
||||
case '|': /* reset all fields to default when not set */
|
||||
timelib_time_reset_unset_fields(s->time);
|
||||
break;
|
||||
|
||||
default:
|
||||
add_pbf_error(s, "Data missing", string, ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* clean up a bit */
|
||||
|
||||
@@ -100,6 +100,7 @@ static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
|
||||
cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
|
||||
if (!cbuffer) {
|
||||
free(buffer);
|
||||
return;
|
||||
}
|
||||
memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt);
|
||||
@@ -125,6 +126,7 @@ static void read_types(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
|
||||
tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
|
||||
if (!tz->type) {
|
||||
free(buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,6 +155,7 @@ static void read_types(const unsigned char **tzf, timelib_tzinfo *tz)
|
||||
|
||||
tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
|
||||
if (!tz->leap_times) {
|
||||
free(leap_buffer);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < tz->leapcnt; i++) {
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#define TIMELIB_VERSION 201101
|
||||
|
||||
#define TIMELIB_NONE 0x00
|
||||
#define TIMELIB_OVERRIDE_TIME 0x01
|
||||
#define TIMELIB_NO_CLONE 0x02
|
||||
|
||||
+886
-1175
File diff suppressed because it is too large.
Load diff
+9
-11
@@ -425,7 +425,7 @@ const zend_function_entry date_functions[] = {
|
||||
PHP_FE(date_sunrise, arginfo_date_sunrise)
|
||||
PHP_FE(date_sunset, arginfo_date_sunset)
|
||||
PHP_FE(date_sun_info, arginfo_date_sun_info)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
const zend_function_entry date_funcs_date[] = {
|
||||
@@ -447,7 +447,7 @@ const zend_function_entry date_funcs_date[] = {
|
||||
PHP_ME_MAPPING(setTimestamp, date_timestamp_set, arginfo_date_method_timestamp_set, 0)
|
||||
PHP_ME_MAPPING(getTimestamp, date_timestamp_get, arginfo_date_method_timestamp_get, 0)
|
||||
PHP_ME_MAPPING(diff, date_diff, arginfo_date_method_diff, 0)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
const zend_function_entry date_funcs_timezone[] = {
|
||||
@@ -458,19 +458,19 @@ const zend_function_entry date_funcs_timezone[] = {
|
||||
PHP_ME_MAPPING(getLocation, timezone_location_get, arginfo_timezone_method_location_get, 0)
|
||||
PHP_ME_MAPPING(listAbbreviations, timezone_abbreviations_list, arginfo_timezone_abbreviations_list, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
PHP_ME_MAPPING(listIdentifiers, timezone_identifiers_list, arginfo_timezone_identifiers_list, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
const zend_function_entry date_funcs_interval[] = {
|
||||
PHP_ME(DateInterval, __construct, arginfo_date_interval_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(format, date_interval_format, arginfo_date_method_interval_format, 0)
|
||||
PHP_ME_MAPPING(createFromDateString, date_interval_create_from_date_string, arginfo_date_interval_create_from_date_string, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
const zend_function_entry date_funcs_period[] = {
|
||||
PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC);
|
||||
@@ -2378,7 +2378,7 @@ static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_D
|
||||
PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC)
|
||||
{
|
||||
timelib_time *now;
|
||||
timelib_tzinfo *tzi;
|
||||
timelib_tzinfo *tzi = NULL;
|
||||
timelib_error_container *err = NULL;
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst;
|
||||
char *new_abbr;
|
||||
@@ -2860,14 +2860,13 @@ PHP_FUNCTION(date_add)
|
||||
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->relative.weekday = 0;
|
||||
dateobj->time->relative.have_weekday_relative = 0;
|
||||
}
|
||||
dateobj->time->have_relative = 1;
|
||||
dateobj->time->sse_uptodate = 0;
|
||||
@@ -2907,6 +2906,7 @@ PHP_FUNCTION(date_sub)
|
||||
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);
|
||||
@@ -2914,8 +2914,6 @@ PHP_FUNCTION(date_sub)
|
||||
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->relative.weekday = 0;
|
||||
dateobj->time->relative.have_weekday_relative = 0;
|
||||
dateobj->time->sse_uptodate = 0;
|
||||
|
||||
timelib_update_ts(dateobj->time, NULL);
|
||||
@@ -3769,7 +3767,7 @@ PHP_METHOD(DatePeriod, __construct)
|
||||
dpobj = zend_object_store_get_object(getThis() TSRMLS_CC);
|
||||
dpobj->current = NULL;
|
||||
|
||||
if (isostr_len) {
|
||||
if (isostr) {
|
||||
date_period_initialize(&(dpobj->start), &(dpobj->end), &(dpobj->interval), &recurrences, isostr, isostr_len TSRMLS_CC);
|
||||
if (dpobj->start == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain a start date.", isostr);
|
||||
|
||||
@@ -10,6 +10,7 @@ Daniel Convissor <danielc@php.net>
|
||||
<?php if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
$date1 = new DateTime('2000-01-01 00:00:00');
|
||||
$date2 = new DateTime('2001-03-04 04:05:06');
|
||||
|
||||
@@ -3,8 +3,13 @@ DateInterval::format(), %a
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
# TestFest 2010 BKTK
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--SKIPIF--
|
||||
<?php if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist"); ?>
|
||||
<?php
|
||||
if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist");
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
|
||||
?>
|
||||
--XFAIL--
|
||||
Windows VC6 libs' floor()/ceil() choke on floats
|
||||
--FILE--
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
DateTime::add() -- dates
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-dates.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test__7: ADD: 2009-01-07 00:00:00 EST + P+0Y0M7DT0H0M0S = **2009-01-14 00:00:00 EST**
|
||||
test_years_positive__7_by_0_day: ADD: 2000-02-07 00:00:00 EST + P+7Y0M0DT0H0M0S = **2007-02-07 00:00:00 EST**
|
||||
test_years_positive__7_by_1_day: ADD: 2000-02-07 00:00:00 EST + P+7Y0M1DT0H0M0S = **2007-02-08 00:00:00 EST**
|
||||
test_years_positive__6_shy_1_day: ADD: 2000-02-07 00:00:00 EST + P+6Y11M30DT0H0M0S = **2007-02-06 00:00:00 EST**
|
||||
test_years_positive__7_by_1_month: ADD: 2000-02-07 00:00:00 EST + P+7Y1M0DT0H0M0S = **2007-03-07 00:00:00 EST**
|
||||
test_years_positive__6_shy_1_month: ADD: 2000-02-07 00:00:00 EST + P+6Y11M0DT0H0M0S = **2007-01-07 00:00:00 EST**
|
||||
test_years_positive__7_by_1_month_split_newyear: ADD: 1999-12-07 00:00:00 EST + P+7Y1M0DT0H0M0S = **2007-01-07 00:00:00 EST**
|
||||
test_years_positive__6_shy_1_month_split_newyear: ADD: 2000-01-07 00:00:00 EST + P+6Y11M0DT0H0M0S = **2006-12-07 00:00:00 EST**
|
||||
test_negative__7: ADD: 2009-01-14 00:00:00 EST + P-0Y0M7DT0H0M0S = **2009-01-07 00:00:00 EST**
|
||||
test_years_negative__7_by_0_day: ADD: 2007-02-07 00:00:00 EST + P-7Y0M0DT0H0M0S = **2000-02-07 00:00:00 EST**
|
||||
test_years_negative__7_by_1_day: ADD: 2007-02-08 00:00:00 EST + P-7Y0M1DT0H0M0S = **2000-02-07 00:00:00 EST**
|
||||
test_years_negative__6_shy_1_day: ADD: 2007-02-06 00:00:00 EST + P-6Y11M28DT0H0M0S = **2000-02-07 00:00:00 EST**
|
||||
test_years_negative__7_by_1_month: ADD: 2007-03-07 00:00:00 EST + P-7Y1M0DT0H0M0S = **2000-02-07 00:00:00 EST**
|
||||
test_years_negative__6_shy_1_month: ADD: 2007-01-07 00:00:00 EST + P-6Y11M0DT0H0M0S = **2000-02-07 00:00:00 EST**
|
||||
test_years_negative__7_by_1_month_split_newyear: ADD: 2007-01-07 00:00:00 EST + P-7Y1M0DT0H0M0S = **1999-12-07 00:00:00 EST**
|
||||
test_years_negative__6_shy_1_month_split_newyear: ADD: 2006-12-07 00:00:00 EST + P-6Y11M0DT0H0M0S = **2000-01-07 00:00:00 EST**
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
DateTime::add() -- fall type2 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Various bugs exist
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-fall-type2-type2.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type2_prev_type2_prev: ADD: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_prev_type2_dt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_prev_type2_redodt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_prev_type2_redost: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_prev_type2_st: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_prev_type2_post: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_dt_type2_prev: ADD: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_dt_type2_dt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT**
|
||||
test_time_fall_type2_dt_type2_redodt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_dt_type2_redost: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_dt_type2_st: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_dt_type2_post: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_redodt_type2_prev: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_redodt_type2_dt: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_redodt_type2_redodt: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT**
|
||||
test_time_fall_type2_redodt_type2_redost: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_redodt_type2_st: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_redodt_type2_post: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_redost_type2_prev: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_redost_type2_dt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_redost_type2_redodt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_redost_type2_redost: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST**
|
||||
test_time_fall_type2_redost_type2_st: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_redost_type2_post: ADD: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_st_type2_prev: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_st_type2_dt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_st_type2_redodt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_st_type2_redost: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_st_type2_st: ADD: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST**
|
||||
test_time_fall_type2_st_type2_post: ADD: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_post_type2_prev: ADD: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_post_type2_dt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_post_type2_redodt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_post_type2_redost: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_post_type2_st: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_post_type2_post: ADD: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_dtsec_type2_stsec: ADD: 2010-11-07 01:59:59 EDT + P+0Y0M0DT0H0M1S = **2010-11-07 01:00:00 EST**
|
||||
test_time_fall_type2_stsec_type2_dtsec: ADD: 2010-11-07 01:00:00 EST + P-0Y0M0DT0H0M1S = **2010-11-07 01:59:59 EDT**
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
DateTime::add() -- fall type2 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Various bugs exist
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-fall-type2-type3.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type2_prev_type3_prev: ADD: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_prev_type3_dt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_prev_type3_redodt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_prev_type3_redost: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_prev_type3_st: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_prev_type3_post: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_dt_type3_prev: ADD: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_dt_type3_dt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT**
|
||||
test_time_fall_type2_dt_type3_redodt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_dt_type3_redost: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_dt_type3_st: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_dt_type3_post: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_redodt_type3_prev: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_redodt_type3_dt: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_redodt_type3_redodt: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT**
|
||||
test_time_fall_type2_redodt_type3_redost: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_redodt_type3_st: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_redodt_type3_post: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_redost_type3_prev: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_redost_type3_dt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_redost_type3_redodt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_redost_type3_redost: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST**
|
||||
test_time_fall_type2_redost_type3_st: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_redost_type3_post: ADD: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_st_type3_prev: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_st_type3_dt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_st_type3_redodt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_st_type3_redost: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_st_type3_st: ADD: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST**
|
||||
test_time_fall_type2_st_type3_post: ADD: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_post_type3_prev: ADD: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type2_post_type3_dt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type2_post_type3_redodt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type2_post_type3_redost: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type2_post_type3_st: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type2_post_type3_post: ADD: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type2_dtsec_type3_stsec: ADD: 2010-11-07 01:59:59 EDT + P+0Y0M0DT0H0M1S = **2010-11-07 01:00:00 EST**
|
||||
test_time_fall_type2_stsec_type3_dtsec: ADD: 2010-11-07 01:00:00 EST + P-0Y0M0DT0H0M1S = **2010-11-07 01:59:59 EDT**
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
DateTime::add() -- fall type3 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Various bugs exist
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-fall-type3-type2.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type3_prev_type2_prev: ADD: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_prev_type2_dt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_prev_type2_redodt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_prev_type2_redost: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_prev_type2_st: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_prev_type2_post: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_dt_type2_prev: ADD: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_dt_type2_dt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT**
|
||||
test_time_fall_type3_dt_type2_redodt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_dt_type2_redost: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_dt_type2_st: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_dt_type2_post: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_redodt_type2_prev: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_redodt_type2_dt: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_redodt_type2_redodt: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT**
|
||||
test_time_fall_type3_redodt_type2_redost: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_redodt_type2_st: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_redodt_type2_post: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_redost_type2_prev: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_redost_type2_dt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_redost_type2_redodt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_redost_type2_redost: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST**
|
||||
test_time_fall_type3_redost_type2_st: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_redost_type2_post: ADD: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_st_type2_prev: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_st_type2_dt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_st_type2_redodt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_st_type2_redost: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_st_type2_st: ADD: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST**
|
||||
test_time_fall_type3_st_type2_post: ADD: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_post_type2_prev: ADD: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_post_type2_dt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_post_type2_redodt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_post_type2_redost: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_post_type2_st: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_post_type2_post: ADD: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_dtsec_type2_stsec: ADD: 2010-11-07 01:59:59 EDT + P+0Y0M0DT0H0M1S = **2010-11-07 01:00:00 EST**
|
||||
test_time_fall_type3_stsec_type2_dtsec: ADD: 2010-11-07 01:00:00 EST + P-0Y0M0DT0H0M1S = **2010-11-07 01:59:59 EDT**
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
DateTime::add() -- fall type3 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Various bugs exist
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-fall-type3-type3.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type3_prev_type3_prev: ADD: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_prev_type3_dt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_prev_type3_redodt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_prev_type3_redost: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_prev_type3_st: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_prev_type3_post: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_dt_type3_prev: ADD: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_dt_type3_dt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT**
|
||||
test_time_fall_type3_dt_type3_redodt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_dt_type3_redost: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_dt_type3_st: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_dt_type3_post: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_redodt_type3_prev: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_redodt_type3_dt: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_redodt_type3_redodt: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT**
|
||||
test_time_fall_type3_redodt_type3_redost: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_redodt_type3_st: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_redodt_type3_post: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_redost_type3_prev: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_redost_type3_dt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_redost_type3_redodt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_redost_type3_redost: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST**
|
||||
test_time_fall_type3_redost_type3_st: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_redost_type3_post: ADD: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_st_type3_prev: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_st_type3_dt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_st_type3_redodt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_st_type3_redost: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_st_type3_st: ADD: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST**
|
||||
test_time_fall_type3_st_type3_post: ADD: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_post_type3_prev: ADD: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT**
|
||||
test_time_fall_type3_post_type3_dt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT**
|
||||
test_time_fall_type3_post_type3_redodt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT**
|
||||
test_time_fall_type3_post_type3_redost: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST**
|
||||
test_time_fall_type3_post_type3_st: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST**
|
||||
test_time_fall_type3_post_type3_post: ADD: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST**
|
||||
test_time_fall_type3_dtsec_type3_stsec: ADD: 2010-11-07 01:59:59 EDT + P+0Y0M0DT0H0M1S = **2010-11-07 01:00:00 EST**
|
||||
test_time_fall_type3_stsec_type3_dtsec: ADD: 2010-11-07 01:00:00 EST + P-0Y0M0DT0H0M1S = **2010-11-07 01:59:59 EDT**
|
||||
@@ -0,0 +1,77 @@
|
||||
--TEST--
|
||||
DateTime::add() -- february
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-february.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_bug_49081__1: ADD: 2010-03-01 00:00:00 EST + P+0Y0M30DT0H0M0S = **2010-03-31 00:00:00 EDT**
|
||||
test_bug_49081__2: ADD: 2010-03-01 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-04-01 00:00:00 EDT**
|
||||
test_bug_49081__3: ADD: 2010-03-31 00:00:00 EDT + P+0Y0M1DT0H0M0S = **2010-04-01 00:00:00 EDT**
|
||||
test_bug_49081__4: ADD: 2010-03-31 00:00:00 EDT + P+0Y0M29DT0H0M0S = **2010-04-29 00:00:00 EDT**
|
||||
test_bug_49081__5: ADD: 2010-03-31 00:00:00 EDT + P+0Y0M30DT0H0M0S = **2010-04-30 00:00:00 EDT**
|
||||
test_bug_49081__6: ADD: 2010-03-30 00:00:00 EDT + P+0Y1M0DT0H0M0S = **2010-04-30 00:00:00 EDT**
|
||||
test_bug_49081__7: ADD: 2010-03-29 00:00:00 EDT + P+0Y1M1DT0H0M0S = **2010-04-30 00:00:00 EDT**
|
||||
test_bug_49081__8: ADD: 2010-01-01 00:00:00 EST + P+0Y0M28DT0H0M0S = **2010-01-29 00:00:00 EST**
|
||||
test_bug_49081__9: ADD: 2010-01-01 00:00:00 EST + P+0Y0M29DT0H0M0S = **2010-01-30 00:00:00 EST**
|
||||
test_bug_49081__10: ADD: 2010-01-01 00:00:00 EST + P+0Y0M30DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081__11: ADD: 2010-01-01 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-02-01 00:00:00 EST**
|
||||
test_bug_49081__12: ADD: 2010-01-31 00:00:00 EST + P+0Y0M1DT0H0M0S = **2010-02-01 00:00:00 EST**
|
||||
test_bug_49081__13: ADD: 2010-01-31 00:00:00 EST + P+0Y0M27DT0H0M0S = **2010-02-27 00:00:00 EST**
|
||||
test_bug_49081__14: ADD: 2010-01-31 00:00:00 EST + P+0Y0M28DT0H0M0S = **2010-02-28 00:00:00 EST**
|
||||
test_bug_49081__15: ADD: 2010-01-30 00:00:00 EST + P+0Y0M29DT0H0M0S = **2010-02-28 00:00:00 EST**
|
||||
test_bug_49081__16: ADD: 2010-01-29 00:00:00 EST + P+0Y0M30DT0H0M0S = **2010-02-28 00:00:00 EST**
|
||||
test_bug_49081__17: ADD: 2010-01-28 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-02-28 00:00:00 EST**
|
||||
test_bug_49081__18: ADD: 2010-01-27 00:00:00 EST + P+0Y1M1DT0H0M0S = **2010-02-28 00:00:00 EST**
|
||||
test_bug_49081__19: ADD: 2010-01-01 00:00:00 EST + P+0Y2M0DT0H0M0S = **2010-03-01 00:00:00 EST**
|
||||
test_bug_49081__20: ADD: 2010-01-31 00:00:00 EST + P+0Y0M29DT0H0M0S = **2010-03-01 00:00:00 EST**
|
||||
test_bug_49081__21: ADD: 2010-01-31 00:00:00 EST + P+0Y1M24DT0H0M0S = **2010-03-27 00:00:00 EDT**
|
||||
test_bug_49081__22: ADD: 2010-01-31 00:00:00 EST + P+0Y1M25DT0H0M0S = **2010-03-28 00:00:00 EDT**
|
||||
test_bug_49081__23: ADD: 2010-01-31 00:00:00 EST + P+0Y1M26DT0H0M0S = **2010-03-29 00:00:00 EDT**
|
||||
test_bug_49081__24: ADD: 2010-01-31 00:00:00 EST + P+0Y1M27DT0H0M0S = **2010-03-30 00:00:00 EDT**
|
||||
test_bug_49081__25: ADD: 2010-01-31 00:00:00 EST + P+0Y2M0DT0H0M0S = **2010-03-31 00:00:00 EDT**
|
||||
test_bug_49081__26: ADD: 2010-01-30 00:00:00 EST + P+0Y2M1DT0H0M0S = **2010-03-31 00:00:00 EDT**
|
||||
test_bug_49081__27: ADD: 2009-01-01 00:00:00 EST + P+0Y0M30DT0H0M0S = **2009-01-31 00:00:00 EST**
|
||||
test_bug_49081__28: ADD: 2010-02-28 00:00:00 EST + P+0Y0M27DT0H0M0S = **2010-03-27 00:00:00 EDT**
|
||||
test_bug_49081__29: ADD: 2010-02-28 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-03-28 00:00:00 EDT**
|
||||
test_bug_49081__30: ADD: 2010-02-28 00:00:00 EST + P+0Y1M1DT0H0M0S = **2010-03-29 00:00:00 EDT**
|
||||
test_bug_49081__31: ADD: 2010-02-27 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-03-27 00:00:00 EDT**
|
||||
test_bug_49081__32: ADD: 2010-02-26 00:00:00 EST + P+0Y1M1DT0H0M0S = **2010-03-27 00:00:00 EDT**
|
||||
test_bug_49081_negative__1: ADD: 2010-03-31 00:00:00 EDT + P-0Y0M30DT0H0M0S = **2010-03-01 00:00:00 EST**
|
||||
test_bug_49081_negative__2: ADD: 2010-04-01 00:00:00 EDT + P-0Y1M0DT0H0M0S = **2010-03-01 00:00:00 EST**
|
||||
test_bug_49081_negative__3: ADD: 2010-04-01 00:00:00 EDT + P-0Y0M1DT0H0M0S = **2010-03-31 00:00:00 EDT**
|
||||
test_bug_49081_negative__4: ADD: 2010-04-29 00:00:00 EDT + P-0Y0M29DT0H0M0S = **2010-03-31 00:00:00 EDT**
|
||||
test_bug_49081_negative__5: ADD: 2010-04-30 00:00:00 EDT + P-0Y0M30DT0H0M0S = **2010-03-31 00:00:00 EDT**
|
||||
test_bug_49081_negative__6: ADD: 2010-04-30 00:00:00 EDT + P-0Y1M0DT0H0M0S = **2010-03-30 00:00:00 EDT**
|
||||
test_bug_49081_negative__7: ADD: 2010-04-30 00:00:00 EDT + P-0Y1M1DT0H0M0S = **2010-03-29 00:00:00 EDT**
|
||||
test_bug_49081_negative__8: ADD: 2010-01-29 00:00:00 EST + P-0Y0M28DT0H0M0S = **2010-01-01 00:00:00 EST**
|
||||
test_bug_49081_negative__9: ADD: 2010-01-30 00:00:00 EST + P-0Y0M29DT0H0M0S = **2010-01-01 00:00:00 EST**
|
||||
test_bug_49081_negative__10: ADD: 2010-01-31 00:00:00 EST + P-0Y0M30DT0H0M0S = **2010-01-01 00:00:00 EST**
|
||||
test_bug_49081_negative__11: ADD: 2010-02-01 00:00:00 EST + P-0Y1M0DT0H0M0S = **2010-01-01 00:00:00 EST**
|
||||
test_bug_49081_negative__12: ADD: 2010-02-01 00:00:00 EST + P-0Y0M1DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__13: ADD: 2010-02-27 00:00:00 EST + P-0Y0M27DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__14: ADD: 2010-02-28 00:00:00 EST + P-0Y0M28DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__15: ADD: 2010-02-28 00:00:00 EST + P-0Y0M29DT0H0M0S = **2010-01-30 00:00:00 EST**
|
||||
test_bug_49081_negative__16: ADD: 2010-02-28 00:00:00 EST + P-0Y0M30DT0H0M0S = **2010-01-29 00:00:00 EST**
|
||||
test_bug_49081_negative__17: ADD: 2010-02-28 00:00:00 EST + P-0Y1M0DT0H0M0S = **2010-01-28 00:00:00 EST**
|
||||
test_bug_49081_negative__18: ADD: 2010-02-28 00:00:00 EST + P-0Y1M1DT0H0M0S = **2010-01-27 00:00:00 EST**
|
||||
test_bug_49081_negative__19: ADD: 2010-03-01 00:00:00 EST + P-0Y2M0DT0H0M0S = **2010-01-01 00:00:00 EST**
|
||||
test_bug_49081_negative__20: ADD: 2010-03-01 00:00:00 EST + P-0Y1M1DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__21: ADD: 2010-03-27 00:00:00 EDT + P-0Y1M27DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__22: ADD: 2010-03-28 00:00:00 EDT + P-0Y1M28DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__23: ADD: 2010-03-29 00:00:00 EDT + P-0Y1M29DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__24: ADD: 2010-03-30 00:00:00 EDT + P-0Y1M30DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__25: ADD: 2010-03-31 00:00:00 EDT + P-0Y2M0DT0H0M0S = **2010-01-31 00:00:00 EST**
|
||||
test_bug_49081_negative__26: ADD: 2010-03-31 00:00:00 EDT + P-0Y2M1DT0H0M0S = **2010-01-30 00:00:00 EST**
|
||||
test_bug_49081_negative__27: ADD: 2009-01-31 00:00:00 EST + P-0Y0M30DT0H0M0S = **2009-01-01 00:00:00 EST**
|
||||
test_bug_49081_negative__28: ADD: 2010-03-27 00:00:00 EDT + P-0Y0M27DT0H0M0S = **2010-02-28 00:00:00 EST**
|
||||
test_bug_49081_negative__29: ADD: 2010-03-28 00:00:00 EDT + P-0Y1M0DT0H0M0S = **2010-02-28 00:00:00 EST**
|
||||
test_bug_49081_negative__30: ADD: 2010-03-29 00:00:00 EDT + P-0Y1M1DT0H0M0S = **2010-02-28 00:00:00 EST**
|
||||
test_bug_49081_negative__31: ADD: 2010-03-27 00:00:00 EDT + P-0Y1M0DT0H0M0S = **2010-02-27 00:00:00 EST**
|
||||
test_bug_49081_negative__32: ADD: 2010-03-27 00:00:00 EDT + P-0Y1M1DT0H0M0S = **2010-02-26 00:00:00 EST**
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
DateTime::add() -- massive
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-massive.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_massive_positive: ADD: -333333-01-01 16:18:02 EST + P+666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 EST**
|
||||
test_massive_negative: ADD: 333333-01-01 16:18:02 EST + P-666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 EST**
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
DateTime::add() -- spring type2 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Various bugs exist
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-spring-type2-type2.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_spring_type2_prev_type2_prev: ADD: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type2_prev_type2_st: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type2_prev_type2_dt: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type2_prev_type2_post: ADD: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_st_type2_prev: ADD: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type2_st_type2_st: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST**
|
||||
test_time_spring_type2_st_type2_dt: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type2_st_type2_post: ADD: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_dt_type2_prev: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type2_dt_type2_st: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type2_dt_type2_dt: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT**
|
||||
test_time_spring_type2_dt_type2_post: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_post_type2_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type2_post_type2_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type2_post_type2_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type2_post_type2_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_stsec_type2_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
|
||||
test_time_spring_type2_dtsec_type2_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
DateTime::add() -- spring type2 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Various bugs exist
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-spring-type2-type3.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_spring_type2_prev_type3_prev: ADD: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type2_prev_type3_st: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type2_prev_type3_dt: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type2_prev_type3_post: ADD: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_st_type3_prev: ADD: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type2_st_type3_st: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST**
|
||||
test_time_spring_type2_st_type3_dt: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type2_st_type3_post: ADD: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_dt_type3_prev: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type2_dt_type3_st: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type2_dt_type3_dt: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT**
|
||||
test_time_spring_type2_dt_type3_post: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_post_type3_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type2_post_type3_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type2_post_type3_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type2_post_type3_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_stsec_type3_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
|
||||
test_time_spring_type2_dtsec_type3_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
DateTime::add() -- spring type3 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Various bugs exist
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-spring-type3-type2.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_spring_type3_prev_type2_prev: ADD: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type3_prev_type2_st: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type3_prev_type2_dt: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type3_prev_type2_post: ADD: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_st_type2_prev: ADD: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type3_st_type2_st: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST**
|
||||
test_time_spring_type3_st_type2_dt: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type3_st_type2_post: ADD: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_dt_type2_prev: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type3_dt_type2_st: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type3_dt_type2_dt: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT**
|
||||
test_time_spring_type3_dt_type2_post: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_post_type2_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type3_post_type2_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type3_post_type2_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type3_post_type2_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_stsec_type2_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
|
||||
test_time_spring_type3_dtsec_type2_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
DateTime::add() -- spring type3 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Various bugs exist
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
|
||||
require 'DateTime_data-spring-type3-type3.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_spring_type3_prev_type3_prev: ADD: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type3_prev_type3_st: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type3_prev_type3_dt: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type3_prev_type3_post: ADD: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_st_type3_prev: ADD: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type3_st_type3_st: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST**
|
||||
test_time_spring_type3_st_type3_dt: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type3_st_type3_post: ADD: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_dt_type3_prev: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type3_dt_type3_st: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type3_dt_type3_dt: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT**
|
||||
test_time_spring_type3_dt_type3_post: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_post_type3_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST**
|
||||
test_time_spring_type3_post_type3_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type3_post_type3_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type3_post_type3_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_stsec_type3_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
|
||||
test_time_spring_type3_dtsec_type3_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
DateTime::__construct() -- fall daylight/standard overlap
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
// PHP defaults to Daylight Saving Time. Ensure consistency in future.
|
||||
$d = new DateTime('2011-11-06 01:30:00');
|
||||
echo $d->format('P') . "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
-04:00
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Note: test names match method names in a set of PHPUnit tests
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
/*
|
||||
* Absolute
|
||||
*/
|
||||
echo "test_absolute_7: ";
|
||||
examine_diff('2009-01-14', '2009-01-07', 'P+0Y0M7DT0H0M0S', 7, true);
|
||||
|
||||
echo "test_absolute_negative_7: ";
|
||||
examine_diff('2009-01-07', '2009-01-14', 'P+0Y0M7DT0H0M0S', 7, true);
|
||||
|
||||
//14 - 7 = 7
|
||||
//7 + 7 = 14
|
||||
//
|
||||
//7 - 14 = -7
|
||||
//14 - 7 = 7
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Note: test names match method names in a set of PHPUnit tests
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
/*
|
||||
* Particular days
|
||||
*/
|
||||
echo "test__7: ";
|
||||
examine_diff('2009-01-14', '2009-01-07', 'P+0Y0M7DT0H0M0S', 7);
|
||||
|
||||
echo "test_years_positive__7_by_0_day: ";
|
||||
examine_diff('2007-02-07', '2000-02-07', 'P+7Y0M0DT0H0M0S', 2557);
|
||||
|
||||
echo "test_years_positive__7_by_1_day: ";
|
||||
examine_diff('2007-02-08', '2000-02-07', 'P+7Y0M1DT0H0M0S', 2558);
|
||||
|
||||
echo "test_years_positive__6_shy_1_day: ";
|
||||
examine_diff('2007-02-06', '2000-02-07', 'P+6Y11M30DT0H0M0S', 2556);
|
||||
|
||||
echo "test_years_positive__7_by_1_month: ";
|
||||
examine_diff('2007-03-07', '2000-02-07', 'P+7Y1M0DT0H0M0S', 2585);
|
||||
|
||||
echo "test_years_positive__6_shy_1_month: ";
|
||||
examine_diff('2007-01-07', '2000-02-07', 'P+6Y11M0DT0H0M0S', 2526);
|
||||
|
||||
echo "test_years_positive__7_by_1_month_split_newyear: ";
|
||||
examine_diff('2007-01-07', '1999-12-07', 'P+7Y1M0DT0H0M0S', 2588);
|
||||
|
||||
echo "test_years_positive__6_shy_1_month_split_newyear: ";
|
||||
examine_diff('2006-12-07', '2000-01-07', 'P+6Y11M0DT0H0M0S', 2526);
|
||||
|
||||
|
||||
/*
|
||||
* Particular days, negative
|
||||
*/
|
||||
echo "test_negative__7: ";
|
||||
examine_diff('2009-01-07', '2009-01-14', 'P-0Y0M7DT0H0M0S', 7);
|
||||
|
||||
echo "test_years_negative__7_by_0_day: ";
|
||||
examine_diff('2000-02-07', '2007-02-07', 'P-7Y0M0DT0H0M0S', 2557);
|
||||
|
||||
echo "test_years_negative__7_by_1_day: ";
|
||||
examine_diff('2000-02-07', '2007-02-08', 'P-7Y0M1DT0H0M0S', 2558);
|
||||
|
||||
echo "test_years_negative__6_shy_1_day: ";
|
||||
examine_diff('2000-02-07', '2007-02-06', 'P-6Y11M28DT0H0M0S', 2556);
|
||||
|
||||
echo "test_years_negative__7_by_1_month: ";
|
||||
examine_diff('2000-02-07', '2007-03-07', 'P-7Y1M0DT0H0M0S', 2585);
|
||||
|
||||
echo "test_years_negative__6_shy_1_month: ";
|
||||
examine_diff('2000-02-07', '2007-01-07', 'P-6Y11M0DT0H0M0S', 2526);
|
||||
|
||||
echo "test_years_negative__7_by_1_month_split_newyear: ";
|
||||
examine_diff('1999-12-07', '2007-01-07', 'P-7Y1M0DT0H0M0S', 2588);
|
||||
|
||||
echo "test_years_negative__6_shy_1_month_split_newyear: ";
|
||||
examine_diff('2000-01-07', '2006-12-07', 'P-6Y11M0DT0H0M0S', 2526);
|
||||
+11
-46
@@ -1,10 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- fall type2 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
PHP < 5.4 has bugs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -25,6 +17,8 @@ date_default_timezone_set('America/New_York');
|
||||
* + redost: standard time in the redo period 2010-11-07 01:14:44 EST
|
||||
* + st: standard time on the transition day 2010-11-07 03:16:55 EST
|
||||
* + post: the day after the transition day 2010-11-08 19:59:59 EST
|
||||
* + dtsec: daylight time 1 sec before change 2010-11-07 01:59:59 EDT
|
||||
* + stsec: standard time first second 2010-11-07 01:00:00 EST
|
||||
*/
|
||||
echo "test_time_fall_type2_prev_type2_prev: ";
|
||||
$end = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
|
||||
@@ -206,41 +200,12 @@ $end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
|
||||
$start = new DateTime('2010-11-08 18:57:55 EST'); // sp post, zt2
|
||||
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type2_prev_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S** | BACK: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT** | DAYS: **33**
|
||||
test_time_fall_type2_prev_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_prev_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_prev_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type2_prev_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type2_prev_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST** | DAYS: **2**
|
||||
test_time_fall_type2_dt_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S** | BACK: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_dt: FWD: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type2_redodt_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_redodt: FWD: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type2_redost_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_redost: FWD: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type2_st_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_st_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_st_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_st_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type2_st_type2_st: FWD: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST** | DAYS: **0**
|
||||
test_time_fall_type2_st_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type2_post_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT** | DAYS: **2**
|
||||
test_time_fall_type2_post_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT** | DAYS: **1**
|
||||
test_time_fall_type2_post_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT** | DAYS: **1**
|
||||
test_time_fall_type2_post_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST** | DAYS: **1**
|
||||
test_time_fall_type2_post_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST** | DAYS: **1**
|
||||
test_time_fall_type2_post_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S** | BACK: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST** | DAYS: **0**
|
||||
echo "test_time_fall_type2_dtsec_type2_stsec: ";
|
||||
$end = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
|
||||
$start = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
|
||||
examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
|
||||
|
||||
echo "test_time_fall_type2_stsec_type2_dtsec: ";
|
||||
$end = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
|
||||
$start = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
|
||||
examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
|
||||
+13
-46
@@ -1,10 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- fall type2 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
PHP < 5.4 has bugs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -25,6 +17,8 @@ date_default_timezone_set('America/New_York');
|
||||
* + redost: standard time in the redo period 2010-11-07 01:14:44 EST
|
||||
* + st: standard time on the transition day 2010-11-07 03:16:55 EST
|
||||
* + post: the day after the transition day 2010-11-08 19:59:59 EST
|
||||
* + dtsec: daylight time 1 sec before change 2010-11-07 01:59:59 EDT
|
||||
* + stsec: standard time first second 2010-11-07 01:00:00 EST
|
||||
*/
|
||||
echo "test_time_fall_type2_prev_type3_prev: ";
|
||||
$end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
|
||||
@@ -218,41 +212,14 @@ $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
|
||||
$start = new DateTime('2010-11-08 18:57:55 EST'); // sp post, zt2
|
||||
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type2_prev_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S** | BACK: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT** | DAYS: **33**
|
||||
test_time_fall_type2_prev_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_prev_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_prev_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type2_prev_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type2_prev_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST** | DAYS: **2**
|
||||
test_time_fall_type2_dt_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S** | BACK: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_dt: FWD: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type2_redodt_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_redodt: FWD: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type2_redost_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_redost: FWD: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type2_st_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_st_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_st_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type2_st_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type2_st_type3_st: FWD: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST** | DAYS: **0**
|
||||
test_time_fall_type2_st_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type2_post_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT** | DAYS: **2**
|
||||
test_time_fall_type2_post_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT** | DAYS: **1**
|
||||
test_time_fall_type2_post_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT** | DAYS: **1**
|
||||
test_time_fall_type2_post_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST** | DAYS: **1**
|
||||
test_time_fall_type2_post_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST** | DAYS: **1**
|
||||
test_time_fall_type2_post_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S** | BACK: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST** | DAYS: **0**
|
||||
echo "test_time_fall_type2_dtsec_type3_stsec: ";
|
||||
$end = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
|
||||
$end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
|
||||
$start = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
|
||||
examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
|
||||
|
||||
echo "test_time_fall_type2_stsec_type3_dtsec: ";
|
||||
$end = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
|
||||
$end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
|
||||
$start = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
|
||||
examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
|
||||
+13
-46
@@ -1,10 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- fall type3 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
PHP < 5.4 has bugs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -25,6 +17,8 @@ date_default_timezone_set('America/New_York');
|
||||
* + redost: standard time in the redo period 2010-11-07 01:14:44 EST
|
||||
* + st: standard time on the transition day 2010-11-07 03:16:55 EST
|
||||
* + post: the day after the transition day 2010-11-08 19:59:59 EST
|
||||
* + dtsec: daylight time 1 sec before change 2010-11-07 01:59:59 EDT
|
||||
* + stsec: standard time first second 2010-11-07 01:00:00 EST
|
||||
*/
|
||||
echo "test_time_fall_type3_prev_type2_prev: ";
|
||||
$end = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
|
||||
@@ -220,41 +214,14 @@ $end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
|
||||
$start = new DateTime('2010-11-08 18:57:55'); // sp post, zt3
|
||||
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type3_prev_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S** | BACK: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT** | DAYS: **33**
|
||||
test_time_fall_type3_prev_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_prev_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_prev_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type3_prev_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type3_prev_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST** | DAYS: **2**
|
||||
test_time_fall_type3_dt_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S** | BACK: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type2_dt: FWD: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type3_redodt_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type2_redodt: FWD: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type3_redost_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type2_redost: FWD: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type3_st_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_st_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_st_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_st_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type3_st_type2_st: FWD: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST** | DAYS: **0**
|
||||
test_time_fall_type3_st_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type3_post_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT** | DAYS: **2**
|
||||
test_time_fall_type3_post_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT** | DAYS: **1**
|
||||
test_time_fall_type3_post_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT** | DAYS: **1**
|
||||
test_time_fall_type3_post_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST** | DAYS: **1**
|
||||
test_time_fall_type3_post_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST** | DAYS: **1**
|
||||
test_time_fall_type3_post_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S** | BACK: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST** | DAYS: **0**
|
||||
echo "test_time_fall_type3_dtsec_type2_stsec: ";
|
||||
$end = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
|
||||
$start = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
|
||||
$start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
|
||||
examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
|
||||
|
||||
echo "test_time_fall_type3_stsec_type2_dtsec: ";
|
||||
$end = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
|
||||
$start = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
|
||||
$start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
|
||||
examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
|
||||
+15
-46
@@ -1,10 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- fall type3 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
PHP < 5.4 has bugs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -25,6 +17,8 @@ date_default_timezone_set('America/New_York');
|
||||
* + redost: standard time in the redo period 2010-11-07 01:14:44 EST, + TZ
|
||||
* + st: standard time on the transition day 2010-11-07 03:16:55
|
||||
* + post: the day after the transition day 2010-11-08 19:59:59
|
||||
* + dtsec: daylight time 1 sec before change 2010-11-07 01:59:59 EDT, + TZ
|
||||
* + stsec: standard time first second 2010-11-07 01:00:00 EST, + TZ
|
||||
*/
|
||||
echo "test_time_fall_type3_prev_type3_prev: ";
|
||||
$end = new DateTime('2010-11-06 18:38:28'); // prev, zt3
|
||||
@@ -230,41 +224,16 @@ $end = new DateTime('2010-11-08 19:59:59'); // post, zt3
|
||||
$start = new DateTime('2010-11-08 18:57:55'); // sp post, zt3
|
||||
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type3_prev_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S** | BACK: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT** | DAYS: **33**
|
||||
test_time_fall_type3_prev_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_prev_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_prev_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type3_prev_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type3_prev_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST** | DAYS: **2**
|
||||
test_time_fall_type3_dt_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S** | BACK: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type3_dt: FWD: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type3_dt_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type3_redodt_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type3_redodt: FWD: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type3_redodt_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type3_redost_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type3_redost: FWD: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST** | DAYS: **0**
|
||||
test_time_fall_type3_redost_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type3_st_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_st_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_st_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
|
||||
test_time_fall_type3_st_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
|
||||
test_time_fall_type3_st_type3_st: FWD: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST** | DAYS: **0**
|
||||
test_time_fall_type3_st_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST** | DAYS: **1**
|
||||
test_time_fall_type3_post_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT** | DAYS: **2**
|
||||
test_time_fall_type3_post_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT** | DAYS: **1**
|
||||
test_time_fall_type3_post_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT** | DAYS: **1**
|
||||
test_time_fall_type3_post_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST** | DAYS: **1**
|
||||
test_time_fall_type3_post_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST** | DAYS: **1**
|
||||
test_time_fall_type3_post_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S** | BACK: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST** | DAYS: **0**
|
||||
echo "test_time_fall_type3_dtsec_type3_stsec: ";
|
||||
$end = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
|
||||
$end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
|
||||
$start = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
|
||||
$start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
|
||||
examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
|
||||
|
||||
echo "test_time_fall_type3_stsec_type3_dtsec: ";
|
||||
$end = new DateTime('2010-11-07 01:59:59 EDT'); // dtsec, zt2
|
||||
$end->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
|
||||
$start = new DateTime('2010-11-07 01:00:00 EST'); // stsec, zt2
|
||||
$start->setTimezone(new DateTimeZone('America/New_York')); // zt2 -> zt3
|
||||
examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
|
||||
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Note: test names match method names in a set of PHPUnit tests
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
/*
|
||||
* Check PHP bug 49081
|
||||
*/
|
||||
echo "test_bug_49081__1: ";
|
||||
examine_diff('2010-03-31', '2010-03-01', 'P+0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081__2: ";
|
||||
examine_diff('2010-04-01', '2010-03-01', 'P+0Y1M0DT0H0M0S', 31);
|
||||
|
||||
echo "test_bug_49081__3: ";
|
||||
examine_diff('2010-04-01', '2010-03-31', 'P+0Y0M1DT0H0M0S', 1);
|
||||
|
||||
echo "test_bug_49081__4: ";
|
||||
examine_diff('2010-04-29', '2010-03-31', 'P+0Y0M29DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081__5: ";
|
||||
examine_diff('2010-04-30', '2010-03-31', 'P+0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081__6: ";
|
||||
examine_diff('2010-04-30', '2010-03-30', 'P+0Y1M0DT0H0M0S', 31);
|
||||
|
||||
echo "test_bug_49081__7: ";
|
||||
examine_diff('2010-04-30', '2010-03-29', 'P+0Y1M1DT0H0M0S', 32);
|
||||
|
||||
echo "test_bug_49081__8: ";
|
||||
examine_diff('2010-01-29', '2010-01-01', 'P+0Y0M28DT0H0M0S', 28);
|
||||
|
||||
echo "test_bug_49081__9: ";
|
||||
examine_diff('2010-01-30', '2010-01-01', 'P+0Y0M29DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081__10: ";
|
||||
examine_diff('2010-01-31', '2010-01-01', 'P+0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081__11: ";
|
||||
examine_diff('2010-02-01', '2010-01-01', 'P+0Y1M0DT0H0M0S', 31);
|
||||
|
||||
echo "test_bug_49081__12: ";
|
||||
examine_diff('2010-02-01', '2010-01-31', 'P+0Y0M1DT0H0M0S', 1);
|
||||
|
||||
echo "test_bug_49081__13: ";
|
||||
examine_diff('2010-02-27', '2010-01-31', 'P+0Y0M27DT0H0M0S', 27);
|
||||
|
||||
echo "test_bug_49081__14: ";
|
||||
examine_diff('2010-02-28', '2010-01-31', 'P+0Y0M28DT0H0M0S', 28);
|
||||
|
||||
echo "test_bug_49081__15: ";
|
||||
examine_diff('2010-02-28', '2010-01-30', 'P+0Y0M29DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081__16: ";
|
||||
examine_diff('2010-02-28', '2010-01-29', 'P+0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081__17: ";
|
||||
examine_diff('2010-02-28', '2010-01-28', 'P+0Y1M0DT0H0M0S', 31);
|
||||
|
||||
echo "test_bug_49081__18: ";
|
||||
examine_diff('2010-02-28', '2010-01-27', 'P+0Y1M1DT0H0M0S', 32);
|
||||
|
||||
echo "test_bug_49081__19: ";
|
||||
examine_diff('2010-03-01', '2010-01-01', 'P+0Y2M0DT0H0M0S', 59);
|
||||
|
||||
echo "test_bug_49081__20: ";
|
||||
examine_diff('2010-03-01', '2010-01-31', 'P+0Y0M29DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081__21: ";
|
||||
examine_diff('2010-03-27', '2010-01-31', 'P+0Y1M24DT0H0M0S', 55);
|
||||
|
||||
echo "test_bug_49081__22: ";
|
||||
examine_diff('2010-03-28', '2010-01-31', 'P+0Y1M25DT0H0M0S', 56);
|
||||
|
||||
echo "test_bug_49081__23: ";
|
||||
examine_diff('2010-03-29', '2010-01-31', 'P+0Y1M26DT0H0M0S', 57);
|
||||
|
||||
echo "test_bug_49081__24: ";
|
||||
examine_diff('2010-03-30', '2010-01-31', 'P+0Y1M27DT0H0M0S', 58);
|
||||
|
||||
echo "test_bug_49081__25: ";
|
||||
examine_diff('2010-03-31', '2010-01-31', 'P+0Y2M0DT0H0M0S', 59);
|
||||
|
||||
echo "test_bug_49081__26: ";
|
||||
examine_diff('2010-03-31', '2010-01-30', 'P+0Y2M1DT0H0M0S', 60);
|
||||
|
||||
echo "test_bug_49081__27: ";
|
||||
examine_diff('2009-01-31', '2009-01-01', 'P+0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081__28: ";
|
||||
examine_diff('2010-03-27', '2010-02-28', 'P+0Y0M27DT0H0M0S', 27);
|
||||
|
||||
echo "test_bug_49081__29: ";
|
||||
examine_diff('2010-03-28', '2010-02-28', 'P+0Y1M0DT0H0M0S', 28);
|
||||
|
||||
echo "test_bug_49081__30: ";
|
||||
examine_diff('2010-03-29', '2010-02-28', 'P+0Y1M1DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081__31: ";
|
||||
examine_diff('2010-03-27', '2010-02-27', 'P+0Y1M0DT0H0M0S', 28);
|
||||
|
||||
echo "test_bug_49081__32: ";
|
||||
examine_diff('2010-03-27', '2010-02-26', 'P+0Y1M1DT0H0M0S', 29);
|
||||
|
||||
|
||||
/*
|
||||
* Check PHP bug 49081, negative
|
||||
*/
|
||||
echo "test_bug_49081_negative__1: ";
|
||||
examine_diff('2010-03-01', '2010-03-31', 'P-0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081_negative__2: ";
|
||||
examine_diff('2010-03-01', '2010-04-01', 'P-0Y1M0DT0H0M0S', 31);
|
||||
|
||||
echo "test_bug_49081_negative__3: ";
|
||||
examine_diff('2010-03-31', '2010-04-01', 'P-0Y0M1DT0H0M0S', 1);
|
||||
|
||||
echo "test_bug_49081_negative__4: ";
|
||||
examine_diff('2010-03-31', '2010-04-29', 'P-0Y0M29DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081_negative__5: ";
|
||||
examine_diff('2010-03-31', '2010-04-30', 'P-0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081_negative__6: ";
|
||||
examine_diff('2010-03-30', '2010-04-30', 'P-0Y1M0DT0H0M0S', 31);
|
||||
|
||||
echo "test_bug_49081_negative__7: ";
|
||||
examine_diff('2010-03-29', '2010-04-30', 'P-0Y1M1DT0H0M0S', 32);
|
||||
|
||||
echo "test_bug_49081_negative__8: ";
|
||||
examine_diff('2010-01-01', '2010-01-29', 'P-0Y0M28DT0H0M0S', 28);
|
||||
|
||||
echo "test_bug_49081_negative__9: ";
|
||||
examine_diff('2010-01-01', '2010-01-30', 'P-0Y0M29DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081_negative__10: ";
|
||||
examine_diff('2010-01-01', '2010-01-31', 'P-0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081_negative__11: ";
|
||||
examine_diff('2010-01-01', '2010-02-01', 'P-0Y1M0DT0H0M0S', 31);
|
||||
|
||||
echo "test_bug_49081_negative__12: ";
|
||||
examine_diff('2010-01-31', '2010-02-01', 'P-0Y0M1DT0H0M0S', 1);
|
||||
|
||||
echo "test_bug_49081_negative__13: ";
|
||||
examine_diff('2010-01-31', '2010-02-27', 'P-0Y0M27DT0H0M0S', 27);
|
||||
|
||||
echo "test_bug_49081_negative__14: ";
|
||||
examine_diff('2010-01-31', '2010-02-28', 'P-0Y0M28DT0H0M0S', 28);
|
||||
|
||||
echo "test_bug_49081_negative__15: ";
|
||||
examine_diff('2010-01-30', '2010-02-28', 'P-0Y0M29DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081_negative__16: ";
|
||||
examine_diff('2010-01-29', '2010-02-28', 'P-0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081_negative__17: ";
|
||||
examine_diff('2010-01-28', '2010-02-28', 'P-0Y1M0DT0H0M0S', 31);
|
||||
|
||||
echo "test_bug_49081_negative__18: ";
|
||||
examine_diff('2010-01-27', '2010-02-28', 'P-0Y1M1DT0H0M0S', 32);
|
||||
|
||||
echo "test_bug_49081_negative__19: ";
|
||||
examine_diff('2010-01-01', '2010-03-01', 'P-0Y2M0DT0H0M0S', 59);
|
||||
|
||||
echo "test_bug_49081_negative__20: ";
|
||||
examine_diff('2010-01-31', '2010-03-01', 'P-0Y1M1DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081_negative__21: ";
|
||||
examine_diff('2010-01-31', '2010-03-27', 'P-0Y1M27DT0H0M0S', 55);
|
||||
|
||||
echo "test_bug_49081_negative__22: ";
|
||||
examine_diff('2010-01-31', '2010-03-28', 'P-0Y1M28DT0H0M0S', 56);
|
||||
|
||||
echo "test_bug_49081_negative__23: ";
|
||||
examine_diff('2010-01-31', '2010-03-29', 'P-0Y1M29DT0H0M0S', 57);
|
||||
|
||||
echo "test_bug_49081_negative__24: ";
|
||||
examine_diff('2010-01-31', '2010-03-30', 'P-0Y1M30DT0H0M0S', 58);
|
||||
|
||||
echo "test_bug_49081_negative__25: ";
|
||||
examine_diff('2010-01-31', '2010-03-31', 'P-0Y2M0DT0H0M0S', 59);
|
||||
|
||||
echo "test_bug_49081_negative__26: ";
|
||||
examine_diff('2010-01-30', '2010-03-31', 'P-0Y2M1DT0H0M0S', 60);
|
||||
|
||||
echo "test_bug_49081_negative__27: ";
|
||||
examine_diff('2009-01-01', '2009-01-31', 'P-0Y0M30DT0H0M0S', 30);
|
||||
|
||||
echo "test_bug_49081_negative__28: ";
|
||||
examine_diff('2010-02-28', '2010-03-27', 'P-0Y0M27DT0H0M0S', 27);
|
||||
|
||||
echo "test_bug_49081_negative__29: ";
|
||||
examine_diff('2010-02-28', '2010-03-28', 'P-0Y1M0DT0H0M0S', 28);
|
||||
|
||||
echo "test_bug_49081_negative__30: ";
|
||||
examine_diff('2010-02-28', '2010-03-29', 'P-0Y1M1DT0H0M0S', 29);
|
||||
|
||||
echo "test_bug_49081_negative__31: ";
|
||||
examine_diff('2010-02-27', '2010-03-27', 'P-0Y1M0DT0H0M0S', 28);
|
||||
|
||||
echo "test_bug_49081_negative__32: ";
|
||||
examine_diff('2010-02-26', '2010-03-27', 'P-0Y1M1DT0H0M0S', 29);
|
||||
-11
@@ -1,8 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- massive
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -10,7 +5,6 @@ Daniel Convissor <danielc@php.net>
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -38,8 +32,3 @@ $start->setDate(333333, 1, 1);
|
||||
$start->setTime(16, 18, 02);
|
||||
|
||||
examine_diff($end, $start, 'P-666666Y0M0DT0H0M0S', 243494757);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_massive_positive: FWD: 333333-01-01 16:18:02 EST - -333333-01-01 16:18:02 EST = **P+666666Y0M0DT0H0M0S** | BACK: -333333-01-01 16:18:02 EST + P+666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 EST** | DAYS: **243494757**
|
||||
test_massive_negative: FWD: -333333-01-01 16:18:02 EST - 333333-01-01 16:18:02 EST = **P-666666Y0M0DT0H0M0S** | BACK: 333333-01-01 16:18:02 EST + P-666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 EST** | DAYS: **243494757**
|
||||
+11
-26
@@ -1,10 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- spring type2 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
PHP < 5.4 has bugs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -23,6 +15,8 @@ date_default_timezone_set('America/New_York');
|
||||
* + st: standard time on transition day 2010-03-14 00:10:20 EST
|
||||
* + dt: daylight time on the transition day 2010-03-14 03:16:55 EDT
|
||||
* + post: the day after the transition day 2010-03-15 19:59:59 EDT
|
||||
* + stsec: standard time 1 sec before change 2010-03-14 01:59:59 EST
|
||||
* + dtsec: daylight time first second 2010-03-14 03:00:00 EDT
|
||||
*/
|
||||
echo "test_time_spring_type2_prev_type2_prev: ";
|
||||
$end = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
|
||||
@@ -104,21 +98,12 @@ $end = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
|
||||
$start = new DateTime('2010-03-15 18:57:55 EDT'); // sp post, zt2
|
||||
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_spring_type2_prev_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S** | BACK: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST** | DAYS: **30**
|
||||
test_time_spring_type2_prev_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST** | DAYS: **0**
|
||||
test_time_spring_type2_prev_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
|
||||
test_time_spring_type2_prev_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT** | DAYS: **2**
|
||||
test_time_spring_type2_st_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S** | BACK: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST** | DAYS: **0**
|
||||
test_time_spring_type2_st_type2_st: FWD: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST** | DAYS: **0**
|
||||
test_time_spring_type2_st_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
|
||||
test_time_spring_type2_st_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
|
||||
test_time_spring_type2_dt_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST** | DAYS: **0**
|
||||
test_time_spring_type2_dt_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST** | DAYS: **0**
|
||||
test_time_spring_type2_dt_type2_dt: FWD: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT** | DAYS: **0**
|
||||
test_time_spring_type2_dt_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
|
||||
test_time_spring_type2_post_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST** | DAYS: **2**
|
||||
test_time_spring_type2_post_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST** | DAYS: **1**
|
||||
test_time_spring_type2_post_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT** | DAYS: **1**
|
||||
test_time_spring_type2_post_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S** | BACK: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT** | DAYS: **0**
|
||||
echo "test_time_spring_type2_stsec_type2_dtsec: ";
|
||||
$end = new DateTime('2010-03-15 03:00:00 EDT'); // dtsec, zt2
|
||||
$start = new DateTime('2010-03-13 01:59:59 EST'); // stsec, zt2
|
||||
examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
|
||||
|
||||
echo "test_time_spring_type2_dtsec_type2_stsec: ";
|
||||
$end = new DateTime('2010-03-15 01:59:59 EST'); // stsec, zt2
|
||||
$start = new DateTime('2010-03-13 03:00:00 EDT'); // dtsec, zt2
|
||||
examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
|
||||
+11
-26
@@ -1,10 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- spring type2 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
PHP < 5.4 has bugs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -23,6 +15,8 @@ date_default_timezone_set('America/New_York');
|
||||
* + st: standard time on transition day 2010-03-14 00:10:20 EST
|
||||
* + dt: daylight time on the transition day 2010-03-14 03:16:55 EDT
|
||||
* + post: the day after the transition day 2010-03-15 19:59:59 EDT
|
||||
* + stsec: standard time 1 sec before change 2010-03-14 01:59:59 EST
|
||||
* + dtsec: daylight time first second 2010-03-14 03:00:00 EDT
|
||||
*/
|
||||
echo "test_time_spring_type2_prev_type3_prev: ";
|
||||
$end = new DateTime('2010-03-13 18:38:28'); // prev, zt3
|
||||
@@ -104,21 +98,12 @@ $end = new DateTime('2010-03-15 19:59:59'); // post, zt3
|
||||
$start = new DateTime('2010-03-15 18:57:55 EDT'); // sp post, zt2
|
||||
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_spring_type2_prev_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S** | BACK: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST** | DAYS: **30**
|
||||
test_time_spring_type2_prev_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST** | DAYS: **0**
|
||||
test_time_spring_type2_prev_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
|
||||
test_time_spring_type2_prev_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT** | DAYS: **2**
|
||||
test_time_spring_type2_st_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S** | BACK: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST** | DAYS: **0**
|
||||
test_time_spring_type2_st_type3_st: FWD: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST** | DAYS: **0**
|
||||
test_time_spring_type2_st_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
|
||||
test_time_spring_type2_st_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
|
||||
test_time_spring_type2_dt_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST** | DAYS: **0**
|
||||
test_time_spring_type2_dt_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST** | DAYS: **0**
|
||||
test_time_spring_type2_dt_type3_dt: FWD: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT** | DAYS: **0**
|
||||
test_time_spring_type2_dt_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
|
||||
test_time_spring_type2_post_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST** | DAYS: **2**
|
||||
test_time_spring_type2_post_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST** | DAYS: **1**
|
||||
test_time_spring_type2_post_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT** | DAYS: **1**
|
||||
test_time_spring_type2_post_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S** | BACK: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT** | DAYS: **0**
|
||||
echo "test_time_spring_type2_stsec_type3_dtsec: ";
|
||||
$end = new DateTime('2010-03-15 03:00:00'); // dtsec, zt3
|
||||
$start = new DateTime('2010-03-13 01:59:59 EST'); // stsec, zt2
|
||||
examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
|
||||
|
||||
echo "test_time_spring_type2_dtsec_type3_stsec: ";
|
||||
$end = new DateTime('2010-03-15 01:59:59'); // stsec, zt3
|
||||
$start = new DateTime('2010-03-13 03:00:00 EDT'); // dtsec, zt2
|
||||
examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
|
||||
+11
-26
@@ -1,10 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- spring type3 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
PHP < 5.4 has bugs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -23,6 +15,8 @@ date_default_timezone_set('America/New_York');
|
||||
* + st: standard time on transition day 2010-03-14 00:10:20 EST
|
||||
* + dt: daylight time on the transition day 2010-03-14 03:16:55 EDT
|
||||
* + post: the day after the transition day 2010-03-15 19:59:59 EDT
|
||||
* + stsec: standard time 1 sec before change 2010-03-14 01:59:59 EST
|
||||
* + dtsec: daylight time first second 2010-03-14 03:00:00 EDT
|
||||
*/
|
||||
echo "test_time_spring_type3_prev_type2_prev: ";
|
||||
$end = new DateTime('2010-03-13 18:38:28 EST'); // prev, zt2
|
||||
@@ -104,21 +98,12 @@ $end = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
|
||||
$start = new DateTime('2010-03-15 18:57:55'); // sp post, zt3
|
||||
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_spring_type3_prev_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S** | BACK: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST** | DAYS: **30**
|
||||
test_time_spring_type3_prev_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST** | DAYS: **0**
|
||||
test_time_spring_type3_prev_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
|
||||
test_time_spring_type3_prev_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT** | DAYS: **2**
|
||||
test_time_spring_type3_st_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S** | BACK: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST** | DAYS: **0**
|
||||
test_time_spring_type3_st_type2_st: FWD: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST** | DAYS: **0**
|
||||
test_time_spring_type3_st_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
|
||||
test_time_spring_type3_st_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
|
||||
test_time_spring_type3_dt_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST** | DAYS: **0**
|
||||
test_time_spring_type3_dt_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST** | DAYS: **0**
|
||||
test_time_spring_type3_dt_type2_dt: FWD: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT** | DAYS: **0**
|
||||
test_time_spring_type3_dt_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
|
||||
test_time_spring_type3_post_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST** | DAYS: **2**
|
||||
test_time_spring_type3_post_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST** | DAYS: **1**
|
||||
test_time_spring_type3_post_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT** | DAYS: **1**
|
||||
test_time_spring_type3_post_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S** | BACK: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT** | DAYS: **0**
|
||||
echo "test_time_spring_type3_stsec_type2_dtsec: ";
|
||||
$end = new DateTime('2010-03-15 03:00:00 EDT'); // dtsec, zt2
|
||||
$start = new DateTime('2010-03-13 01:59:59'); // stsec, zt3
|
||||
examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
|
||||
|
||||
echo "test_time_spring_type3_dtsec_type2_stsec: ";
|
||||
$end = new DateTime('2010-03-15 01:59:59 EST'); // stsec, zt2
|
||||
$start = new DateTime('2010-03-13 03:00:00'); // dtsec, zt3
|
||||
examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
|
||||
+11
-26
@@ -1,10 +1,3 @@
|
||||
--TEST--
|
||||
DateTime::diff() add() sub() -- spring type3 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
PHP < 5.4 has bugs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
|
||||
* in a userland package. Please be so kind as to leave them.
|
||||
*/
|
||||
|
||||
require './examine_diff.inc';
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
|
||||
@@ -23,6 +15,8 @@ date_default_timezone_set('America/New_York');
|
||||
* + st: standard time on transition day 2010-03-14 00:10:20
|
||||
* + dt: daylight time on the transition day 2010-03-14 03:16:55
|
||||
* + post: the day after the transition day 2010-03-15 19:59:59
|
||||
* + stsec: standard time 1 sec before change 2010-03-14 01:59:59
|
||||
* + dtsec: daylight time first second 2010-03-14 03:00:00
|
||||
*/
|
||||
echo "test_time_spring_type3_prev_type3_prev: ";
|
||||
$end = new DateTime('2010-03-13 18:38:28'); // prev, zt3
|
||||
@@ -104,21 +98,12 @@ $end = new DateTime('2010-03-15 19:59:59'); // post, zt3
|
||||
$start = new DateTime('2010-03-15 18:57:55'); // sp post, zt3
|
||||
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_spring_type3_prev_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S** | BACK: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST** | DAYS: **30**
|
||||
test_time_spring_type3_prev_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST** | DAYS: **0**
|
||||
test_time_spring_type3_prev_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
|
||||
test_time_spring_type3_prev_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT** | DAYS: **2**
|
||||
test_time_spring_type3_st_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S** | BACK: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST** | DAYS: **0**
|
||||
test_time_spring_type3_st_type3_st: FWD: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST** | DAYS: **0**
|
||||
test_time_spring_type3_st_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
|
||||
test_time_spring_type3_st_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
|
||||
test_time_spring_type3_dt_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST** | DAYS: **0**
|
||||
test_time_spring_type3_dt_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST** | DAYS: **0**
|
||||
test_time_spring_type3_dt_type3_dt: FWD: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT** | DAYS: **0**
|
||||
test_time_spring_type3_dt_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
|
||||
test_time_spring_type3_post_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST** | DAYS: **2**
|
||||
test_time_spring_type3_post_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST** | DAYS: **1**
|
||||
test_time_spring_type3_post_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT** | DAYS: **1**
|
||||
test_time_spring_type3_post_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S** | BACK: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT** | DAYS: **0**
|
||||
echo "test_time_spring_type3_stsec_type3_dtsec: ";
|
||||
$end = new DateTime('2010-03-15 03:00:00'); // dtsec, zt3
|
||||
$start = new DateTime('2010-03-13 01:59:59'); // stsec, zt3
|
||||
examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
|
||||
|
||||
echo "test_time_spring_type3_dtsec_type3_stsec: ";
|
||||
$end = new DateTime('2010-03-15 01:59:59'); // stsec, zt3
|
||||
$start = new DateTime('2010-03-13 03:00:00'); // dtsec, zt3
|
||||
examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
DateTime::diff() days -- absolute
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
|
||||
require 'DateTime_data-absolute.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_absolute_7: DAYS: **7**
|
||||
test_absolute_negative_7: DAYS: **7**
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
DateTime::diff() days -- dates
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
|
||||
require 'DateTime_data-dates.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test__7: DAYS: **7**
|
||||
test_years_positive__7_by_0_day: DAYS: **2557**
|
||||
test_years_positive__7_by_1_day: DAYS: **2558**
|
||||
test_years_positive__6_shy_1_day: DAYS: **2556**
|
||||
test_years_positive__7_by_1_month: DAYS: **2585**
|
||||
test_years_positive__6_shy_1_month: DAYS: **2526**
|
||||
test_years_positive__7_by_1_month_split_newyear: DAYS: **2588**
|
||||
test_years_positive__6_shy_1_month_split_newyear: DAYS: **2526**
|
||||
test_negative__7: DAYS: **7**
|
||||
test_years_negative__7_by_0_day: DAYS: **2557**
|
||||
test_years_negative__7_by_1_day: DAYS: **2558**
|
||||
test_years_negative__6_shy_1_day: DAYS: **2556**
|
||||
test_years_negative__7_by_1_month: DAYS: **2585**
|
||||
test_years_negative__6_shy_1_month: DAYS: **2526**
|
||||
test_years_negative__7_by_1_month_split_newyear: DAYS: **2588**
|
||||
test_years_negative__6_shy_1_month_split_newyear: DAYS: **2526**
|
||||
@@ -0,0 +1,51 @@
|
||||
--TEST--
|
||||
DateTime::diff() days -- fall type2 type2
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
|
||||
require 'DateTime_data-fall-type2-type2.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type2_prev_type2_prev: DAYS: **33**
|
||||
test_time_fall_type2_prev_type2_dt: DAYS: **0**
|
||||
test_time_fall_type2_prev_type2_redodt: DAYS: **0**
|
||||
test_time_fall_type2_prev_type2_redost: DAYS: **0**
|
||||
test_time_fall_type2_prev_type2_st: DAYS: **0**
|
||||
test_time_fall_type2_prev_type2_post: DAYS: **2**
|
||||
test_time_fall_type2_dt_type2_prev: DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_dt: DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_redodt: DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_redost: DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_st: DAYS: **0**
|
||||
test_time_fall_type2_dt_type2_post: DAYS: **1**
|
||||
test_time_fall_type2_redodt_type2_prev: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_dt: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_redodt: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_redost: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_st: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type2_post: DAYS: **1**
|
||||
test_time_fall_type2_redost_type2_prev: DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_dt: DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_redodt: DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_redost: DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_st: DAYS: **0**
|
||||
test_time_fall_type2_redost_type2_post: DAYS: **1**
|
||||
test_time_fall_type2_st_type2_prev: DAYS: **0**
|
||||
test_time_fall_type2_st_type2_dt: DAYS: **0**
|
||||
test_time_fall_type2_st_type2_redodt: DAYS: **0**
|
||||
test_time_fall_type2_st_type2_redost: DAYS: **0**
|
||||
test_time_fall_type2_st_type2_st: DAYS: **0**
|
||||
test_time_fall_type2_st_type2_post: DAYS: **1**
|
||||
test_time_fall_type2_post_type2_prev: DAYS: **2**
|
||||
test_time_fall_type2_post_type2_dt: DAYS: **1**
|
||||
test_time_fall_type2_post_type2_redodt: DAYS: **1**
|
||||
test_time_fall_type2_post_type2_redost: DAYS: **1**
|
||||
test_time_fall_type2_post_type2_st: DAYS: **1**
|
||||
test_time_fall_type2_post_type2_post: DAYS: **0**
|
||||
test_time_fall_type2_dtsec_type2_stsec: DAYS: **0**
|
||||
test_time_fall_type2_stsec_type2_dtsec: DAYS: **0**
|
||||
@@ -0,0 +1,51 @@
|
||||
--TEST--
|
||||
DateTime::diff() days -- fall type2 type3
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
|
||||
require 'DateTime_data-fall-type2-type3.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test_time_fall_type2_prev_type3_prev: DAYS: **33**
|
||||
test_time_fall_type2_prev_type3_dt: DAYS: **0**
|
||||
test_time_fall_type2_prev_type3_redodt: DAYS: **0**
|
||||
test_time_fall_type2_prev_type3_redost: DAYS: **0**
|
||||
test_time_fall_type2_prev_type3_st: DAYS: **0**
|
||||
test_time_fall_type2_prev_type3_post: DAYS: **2**
|
||||
test_time_fall_type2_dt_type3_prev: DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_dt: DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_redodt: DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_redost: DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_st: DAYS: **0**
|
||||
test_time_fall_type2_dt_type3_post: DAYS: **1**
|
||||
test_time_fall_type2_redodt_type3_prev: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_dt: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_redodt: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_redost: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_st: DAYS: **0**
|
||||
test_time_fall_type2_redodt_type3_post: DAYS: **1**
|
||||
test_time_fall_type2_redost_type3_prev: DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_dt: DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_redodt: DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_redost: DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_st: DAYS: **0**
|
||||
test_time_fall_type2_redost_type3_post: DAYS: **1**
|
||||
test_time_fall_type2_st_type3_prev: DAYS: **0**
|
||||
test_time_fall_type2_st_type3_dt: DAYS: **0**
|
||||
test_time_fall_type2_st_type3_redodt: DAYS: **0**
|
||||
test_time_fall_type2_st_type3_redost: DAYS: **0**
|
||||
test_time_fall_type2_st_type3_st: DAYS: **0**
|
||||
test_time_fall_type2_st_type3_post: DAYS: **1**
|
||||
test_time_fall_type2_post_type3_prev: DAYS: **2**
|
||||
test_time_fall_type2_post_type3_dt: DAYS: **1**
|
||||
test_time_fall_type2_post_type3_redodt: DAYS: **1**
|
||||
test_time_fall_type2_post_type3_redost: DAYS: **1**
|
||||
test_time_fall_type2_post_type3_st: DAYS: **1**
|
||||
test_time_fall_type2_post_type3_post: DAYS: **0**
|
||||
test_time_fall_type2_dtsec_type3_stsec: DAYS: **0**
|
||||
test_time_fall_type2_stsec_type3_dtsec: DAYS: **0**
|
||||
Loaded 100 of 876 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user