mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
320
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59c5558e5d | ||
|
|
4b24f8849f | ||
|
|
f156e684ac | ||
|
|
b1df00a7c9 | ||
|
|
c14388d63f | ||
|
|
a056113586 | ||
|
|
97bf254385 | ||
|
|
61199be02f | ||
|
|
7894e397d8 | ||
|
|
50d50c2f04 | ||
|
|
a6fa52028f | ||
|
|
a7c50ccc67 | ||
|
|
bb51d0e4c0 | ||
|
|
20eb8e4d11 | ||
|
|
3624a9ca7a | ||
|
|
2303d0ea22 | ||
|
|
cbcf6e1880 | ||
|
|
68a73ce3c4 | ||
|
|
1b3e2c299d | ||
|
|
cbc98df99e | ||
|
|
3eb2b1ac40 | ||
|
|
c59f3184a3 | ||
|
|
6f739318fd | ||
|
|
8650bbc8dc | ||
|
|
c1224573c7 | ||
|
|
a0955f351c | ||
|
|
ff89066b3d | ||
|
|
8f1fee61e2 | ||
|
|
b1b23abc86 | ||
|
|
71daf3229b | ||
|
|
3e963f8eb4 | ||
|
|
c062c18d42 | ||
|
|
b5f5bff965 | ||
|
|
098d2a5d0f | ||
|
|
86aad97979 | ||
|
|
d1314893fd | ||
|
|
22fa3fbc5f | ||
|
|
6408a1a59e | ||
|
|
edbefd1d5c | ||
|
|
9ed605892d | ||
|
|
2d31eadbbf | ||
|
|
d22cc5c816 | ||
|
|
c1eb219aad | ||
|
|
aab0b2ce3b | ||
|
|
582f6e529e | ||
|
|
5d0c526199 | ||
|
|
324e6a5f82 | ||
|
|
aa26ace21f | ||
|
|
7a0df7be34 | ||
|
|
6e8b2c91c4 | ||
|
|
261c6b31ca | ||
|
|
44a9e6b484 | ||
|
|
fb0c2cf224 | ||
|
|
23ab2575e1 | ||
|
|
504c60dc44 | ||
|
|
16d59aa171 | ||
|
|
12fe4e90be | ||
|
|
63f3ff7b5f | ||
|
|
0aadab0e2e | ||
|
|
74ba88e186 | ||
|
|
1b0e6067d5 | ||
|
|
345032946c | ||
|
|
ce09822269 | ||
|
|
4a1c9be857 | ||
|
|
b902a25cc3 | ||
|
|
0d558afc05 | ||
|
|
050dd59c63 | ||
|
|
101c780500 | ||
|
|
25c08a839a | ||
|
|
823e330c75 | ||
|
|
c9cfd98bcd | ||
|
|
288e9c6423 | ||
|
|
064ba179b1 | ||
|
|
cf2626f10c | ||
|
|
fd3fa9b53c | ||
|
|
224dc52ea9 | ||
|
|
890ea8411f | ||
|
|
8cb128159d | ||
|
|
8b6b39fdcf | ||
|
|
290becb1f1 | ||
|
|
9c1e1bbc05 | ||
|
|
c439ac6c35 | ||
|
|
e3d9e18e7b | ||
|
|
2b7e89e20a | ||
|
|
d3fd163d27 | ||
|
|
b4bed6fde0 | ||
|
|
4ded6ee971 | ||
|
|
0d89265a69 | ||
|
|
16a9fec889 | ||
|
|
4dc4302a30 | ||
|
|
e2c9f3983a | ||
|
|
69808d698c | ||
|
|
ab6481993e | ||
|
|
7a526f01b5 | ||
|
|
9b399be778 | ||
|
|
e18e7a5983 | ||
|
|
e50eb1ce34 | ||
|
|
9cb3a759a7 | ||
|
|
1f5b1cfb2b | ||
|
|
2cf5614f5f | ||
|
|
5cc797d119 | ||
|
|
2fa5f39e4c | ||
|
|
1b43f95040 | ||
|
|
2ecf94e07e | ||
|
|
f860486de5 | ||
|
|
297324146e | ||
|
|
27ebcb8d0e | ||
|
|
2186e1583d | ||
|
|
18cc5386de | ||
|
|
8f4a6d6e1b | ||
|
|
1494298231 | ||
|
|
9976b5cd7f | ||
|
|
52555a7894 | ||
|
|
b6feabc8c6 | ||
|
|
33d377e701 | ||
|
|
fb38fdc7fd | ||
|
|
a1daebefda | ||
|
|
420068c6e1 | ||
|
|
85a622e42f | ||
|
|
aa4f9b322b | ||
|
|
2be67ca457 | ||
|
|
813e867652 | ||
|
|
a55d3b9295 | ||
|
|
df501fd464 | ||
|
|
6919d15a2e | ||
|
|
1fe1f7305b | ||
|
|
4c0bb6d76e | ||
|
|
872ef919ca | ||
|
|
29e755ac66 | ||
|
|
8495d63034 | ||
|
|
b0a36007ab | ||
|
|
9ccde8a415 | ||
|
|
7a038ccbe6 | ||
|
|
960b4e81f3 | ||
|
|
9fbfdb3396 | ||
|
|
22700890d4 | ||
|
|
b026993a74 | ||
|
|
b5a0f12871 | ||
|
|
63f242178d | ||
|
|
d74b9cfee5 | ||
|
|
690bbe170d | ||
|
|
3aaee86ee3 | ||
|
|
248afd1c3c | ||
|
|
6a823071f9 | ||
|
|
96cc419924 | ||
|
|
8973390541 | ||
|
|
e8ae795529 | ||
|
|
76d2d474be | ||
|
|
f6ff3a28d6 | ||
|
|
545363cce0 | ||
|
|
dc3d360a0f | ||
|
|
fc3f8a8f54 | ||
|
|
9209c19f8f | ||
|
|
dbe2d7745f | ||
|
|
b2f8f35a88 | ||
|
|
33fd0e0b78 | ||
|
|
cd1cab3f47 | ||
|
|
930946005e | ||
|
|
18b04b480e | ||
|
|
679bf479b6 | ||
|
|
2b78edfba2 | ||
|
|
e9e63f9223 | ||
|
|
f0c926564c | ||
|
|
d143c2b60f | ||
|
|
7e35004e39 | ||
|
|
0ad0a2f56e | ||
|
|
7a1a1aec8c | ||
|
|
ac05cfb499 | ||
|
|
9aa904c375 | ||
|
|
b4b4372c88 | ||
|
|
30e0442c54 | ||
|
|
34fc79bd61 | ||
|
|
cc66eaa04b | ||
|
|
d5ba2d8a99 | ||
|
|
7a24ee13ec | ||
|
|
7e9044b6a2 | ||
|
|
9bfd55cda3 | ||
|
|
2524428504 | ||
|
|
dfd7d1063a | ||
|
|
7c279df6ae | ||
|
|
6a0b90da84 | ||
|
|
1939d9e3db | ||
|
|
18b54a2366 | ||
|
|
8a936e8eb9 | ||
|
|
c0afe829e3 | ||
|
|
a475b2c1db | ||
|
|
7bb8cbcdee | ||
|
|
160cd8d0a7 | ||
|
|
3c3b2b5bdc | ||
|
|
7beef74a82 | ||
|
|
6c48c6bc78 | ||
|
|
ed038d2ee3 | ||
|
|
bfb1fe10cb | ||
|
|
d69513afec | ||
|
|
7da6498342 | ||
|
|
5bff1286b6 | ||
|
|
dfc6feb6e8 | ||
|
|
15694f66b2 | ||
|
|
747daa5354 | ||
|
|
72027cd084 | ||
|
|
1fdcc705a4 | ||
|
|
3745bdadc0 | ||
|
|
e6424d89e9 | ||
|
|
b378b0b081 | ||
|
|
e22c139fe0 | ||
|
|
6b8dade6dc | ||
|
|
3f9af558e7 | ||
|
|
768c34e7cd | ||
|
|
5ab6d215fc | ||
|
|
7109f369e8 | ||
|
|
f2ceb4963e | ||
|
|
d5987478a8 | ||
|
|
54d4a28003 | ||
|
|
1af111dd68 | ||
|
|
d0bede2efa | ||
|
|
f38bd22ed2 | ||
|
|
d8023d13eb | ||
|
|
540f325664 | ||
|
|
696852f2bd | ||
|
|
5c06e5c2e0 | ||
|
|
e9b12bedc3 | ||
|
|
9c9fee3f43 | ||
|
|
d82f9339fe | ||
|
|
eba85f91d8 | ||
|
|
b455ba971c | ||
|
|
27c803aaed | ||
|
|
72d1ec883e | ||
|
|
9789df7764 | ||
|
|
d487f5e9ac | ||
|
|
dc384a571d | ||
|
|
c60067c09a | ||
|
|
1ac4d8f2c6 | ||
|
|
aa7d3d8e6d | ||
|
|
a4862503d4 | ||
|
|
32873cd0dd | ||
|
|
71c24f4c2e | ||
|
|
4bad49e3bc | ||
|
|
cf96aa155e | ||
|
|
c1c49d6e39 | ||
|
|
14f5732096 | ||
|
|
9973658a44 | ||
|
|
0154db1c5f | ||
|
|
98d29d20a1 | ||
|
|
a3fa25e857 | ||
|
|
3da2fb335d | ||
|
|
ac2d2b9b72 | ||
|
|
4a0e87e497 | ||
|
|
cb539b3e96 | ||
|
|
6993ca5bd7 | ||
|
|
0ebef462ce | ||
|
|
060fadca31 | ||
|
|
ba30c78d5c | ||
|
|
8280393828 | ||
|
|
9ad97cd489 | ||
|
|
9d62807190 | ||
|
|
7f69f07fc1 | ||
|
|
dcea4ec698 | ||
|
|
2874696a5a | ||
|
|
f4dc2240a0 | ||
|
|
72aacbf735 | ||
|
|
4134ebec8e | ||
|
|
cf39c3d638 | ||
|
|
36b759d1dd | ||
|
|
503d39d925 | ||
|
|
bff1a96a0f | ||
|
|
0ad81ac18a | ||
|
|
e9b128c1bf | ||
|
|
ac28283beb | ||
|
|
fc7fe62e3b | ||
|
|
a188693a27 | ||
|
|
80fe5461a9 | ||
|
|
4ed133c4e2 | ||
|
|
2743c3aac8 | ||
|
|
a831499b4a | ||
|
|
47d66a0b4e | ||
|
|
3bbe5931bc | ||
|
|
a5c524f1be | ||
|
|
3c5e229212 | ||
|
|
ec4019e8f6 | ||
|
|
cabf38af6d | ||
|
|
f718684a6c | ||
|
|
a93a462dce | ||
|
|
8d86597d73 | ||
|
|
5f137d080a | ||
|
|
a03f0943ca | ||
|
|
d60e168a7a | ||
|
|
ea75b1b5db | ||
|
|
e55f08a5ae | ||
|
|
5753b74fab | ||
|
|
ce9169e360 | ||
|
|
cb13f8318b | ||
|
|
4590070f31 | ||
|
|
4395f70207 | ||
|
|
fd8f454520 | ||
|
|
0a974f14d1 | ||
|
|
1d7b6970f2 | ||
|
|
fd616ba50f | ||
|
|
29b2522df1 | ||
|
|
979194351d | ||
|
|
515092917d | ||
|
|
9909c4d4c4 | ||
|
|
96a53f6715 | ||
|
|
c28ab73d73 | ||
|
|
9b6aa268a3 | ||
|
|
a1bf38e075 | ||
|
|
7c9bb87edd | ||
|
|
25f924abf6 | ||
|
|
f8efdc2b4b | ||
|
|
1b4103c09d | ||
|
|
ba984582db | ||
|
|
da3886de6d | ||
|
|
3380de9774 | ||
|
|
cc91fbe986 | ||
|
|
b963249456 | ||
|
|
a015fa83a7 | ||
|
|
2b9d42433f | ||
|
|
445dffa75a | ||
|
|
b9e3f737d9 | ||
|
|
e6ae977082 | ||
|
|
ba3234888d |
No files matched your search
+3
-3
@@ -59,8 +59,8 @@ Exceptions:
|
||||
you're calling.
|
||||
|
||||
7. When commenting out code using a #if statement, do NOT use 0 only. Instead
|
||||
use "<svn username here>_0". For example, #if FOO_0, where FOO is your
|
||||
svn user foo. This allows easier tracking of why code was commented out,
|
||||
use "<git username here>_0". For example, #if FOO_0, where FOO is your
|
||||
git user foo. This allows easier tracking of why code was commented out,
|
||||
especially in bundled libraries.
|
||||
|
||||
8. Do not define functions that are not available. For instance, if a
|
||||
@@ -151,7 +151,7 @@ Naming Conventions
|
||||
|
||||
7. Classes should be given descriptive names. Avoid using abbreviations where
|
||||
possible. Each word in the class name should start with a capital letter,
|
||||
without underscore delimiters (CampelCaps starting with a capital letter).
|
||||
without underscore delimiters (CamelCaps starting with a capital letter).
|
||||
The class name should be prefixed with the name of the 'parent set' (e.g.
|
||||
the name of the extension)::
|
||||
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ all: $(all_targets)
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@echo
|
||||
|
||||
|
||||
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
|
||||
|
||||
build-binaries: $(PHP_BINARIES)
|
||||
@@ -116,7 +116,7 @@ clean:
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
|
||||
@@ -1,12 +1,231 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
09 Jan 2014, PHP 5.4.24
|
||||
|
||||
- Core:
|
||||
. Added validation of class names in the autoload process. (Dmitry)
|
||||
. Fixed invalid C code in zend_strtod.c. (Lior Kaplan)
|
||||
. Fixed bug #61645 (fopen and O_NONBLOCK). (Mike)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #66060 (Heap buffer over-read in DateInterval). (Remi)
|
||||
. Fixed bug #63391 (Incorrect/inconsistent day of week prior to the year
|
||||
1600). (Derick, T. Carter)
|
||||
. Fixed bug #61599 (Wrong Day of Week). (Derick, T. Carter)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML()
|
||||
Produces invalid Markup). (Mike)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #65873 (Integer overflow in exif_read_data()). (Stas)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #66229 (128.0.0.0/16 isn't reserved any longer). (Adam)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)).
|
||||
(Adam)
|
||||
|
||||
- PDO_odbc:
|
||||
. Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries).
|
||||
(michael at orlitzky dot com)
|
||||
|
||||
- SNMP:
|
||||
. Fixed SNMP_ERR_TOOBIG handling for bulk walk operations. (Boris Lytochkin)
|
||||
|
||||
- XSL
|
||||
. Fixed bug #49634 (Segfault throwing an exception in a XSL registered
|
||||
function). (Mike)
|
||||
|
||||
- ZIP:
|
||||
. Fixed Bug #66321 (ZipArchive::open() ze_obj->filename_len not real). (Remi)
|
||||
|
||||
12 Dec 2013, PHP 5.4.23
|
||||
|
||||
- Core:
|
||||
. Fixed bug #66094 (unregister_tick_function tries to cast a Closure to a
|
||||
string). (Laruence)
|
||||
. Fixed bug #65969 (Chain assignment with T_LIST failure). (Dmitry)
|
||||
. Fixed bug #65947 (basename is no more working after fgetcsv in certain
|
||||
situation). (Laruence)
|
||||
|
||||
- JSON
|
||||
. Fixed whitespace part of bug #64874 ("json_decode handles whitespace and
|
||||
case-sensitivity incorrectly"). (Andrea Faulds)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #66043 (Segfault calling bind_param() on mysqli). (Laruence)
|
||||
|
||||
- mysqlnd:
|
||||
. Fixed bug #66124 (mysqli under mysqlnd loses precision when bind_param
|
||||
with 'i'). (Andrey)
|
||||
. Fixed bug #66141 (mysqlnd quote function is wrong with NO_BACKSLASH_ESCAPES
|
||||
after failed query). (Andrey)
|
||||
|
||||
- Openssl:
|
||||
. Fixed memory corruption in openssl_x509_parse() (CVE-2013-6420).
|
||||
(Stefan Esser).
|
||||
|
||||
- PDO
|
||||
. Fixed bug 65946 (sql_parser permanently converts values bound to strings)
|
||||
|
||||
14 Nov 2013, PHP 5.4.22
|
||||
|
||||
- Core:
|
||||
. Fixed bug #65911 (scope resolution operator - strange behavior with $this).
|
||||
(Bob Weinand)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #65818 (Segfault with built-in webserver and chunked transfer
|
||||
encoding). (Felipe)
|
||||
|
||||
- Exif:
|
||||
. Fixed crash on unknown encoding. (Draal)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #65950 (Field name truncation if the field name is bigger than
|
||||
32 characters). (patch submitted by: michael dot y at zend dot com, Yasuo)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #66033 (Segmentation Fault when constructor of PDO statement
|
||||
throws an exception). (Laruence)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
|
||||
(Mike)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #64760 (var_export() does not use full precision for floating-point
|
||||
numbers) (Yasuo)
|
||||
|
||||
- XMLReader:
|
||||
. Fixed bug #51936 (Crash with clone XMLReader). (Mike)
|
||||
. Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
|
||||
|
||||
|
||||
17 Oct 2013, PHP 5.4.21
|
||||
|
||||
- Core:
|
||||
. Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #65633 (built-in server treat some http headers as
|
||||
case-sensitive). (Adam)
|
||||
|
||||
- Datetime:
|
||||
. Fixed bug #64157 (DateTime::createFromFormat() reports confusing error
|
||||
message). (Boro Sitnikovski)
|
||||
|
||||
- DBA extension:
|
||||
. Fixed bug #65708 (dba functions cast $key param to string in-place,
|
||||
bypassing copy on write). (Adam)
|
||||
|
||||
- Filter:
|
||||
. Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn)
|
||||
. Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names).
|
||||
(Syra)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling
|
||||
imap). (ryotakatsuki at gmail dot com)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #61548 (content-type must appear at the end of headers for 201
|
||||
Location to work in http). (Mike)
|
||||
|
||||
- Build system:
|
||||
. Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing
|
||||
gzencode())). (Mike)
|
||||
|
||||
|
||||
19 Sep 2013, PHP 5.4.20
|
||||
|
||||
- Core:
|
||||
. Fixed bug #60598 (cli/apache sapi segfault on objects manipulation).
|
||||
(Laruence)
|
||||
. Fixed bug #65579 (Using traits with get_class_methods causes segfault).
|
||||
(Adam)
|
||||
. Fixed bug #65490 (Duplicate calls to get lineno & filename for
|
||||
DTRACE_FUNCTION_*). (Chris Jones)
|
||||
. Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding
|
||||
spaces). (Michael M Slusarz)
|
||||
. Fixed bug #65481 (shutdown segfault due to serialize) (Mike)
|
||||
. Fixed bug #65470 (Segmentation fault in zend_error() with
|
||||
--enable-dtrace). (Chris Jones, Kris Van Hees)
|
||||
. Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference
|
||||
fails). (Laruence)
|
||||
. Fixed bug #65304 (Use of max int in array_sum). (Laruence)
|
||||
. Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very
|
||||
limited case). (Arpad)
|
||||
. Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)
|
||||
. Improved fix for bug #63186 (compile failure on netbsd). (Matteo)
|
||||
. Fixed bug #62692 (PHP fails to build with DTrace). (Chris Jones, Kris Van Hees)
|
||||
. Fixed bug #61759 (class_alias() should accept classes with leading
|
||||
backslashes). (Julien)
|
||||
. Fixed bug #61345 (CGI mode - make install don't work). (Michael Heimpold)
|
||||
. Cherry-picked some DTrace build commits (allowing builds on Linux,
|
||||
bug #62691, and bug #63706) from PHP 5.5 branch
|
||||
. Fixed bug #61268 (--enable-dtrace leads make to clobber
|
||||
Zend/zend_dtrace.d) (Chris Jones)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #65458 (curl memory leak). (Adam)
|
||||
|
||||
- Datetime:
|
||||
. Fixed bug #65554 (createFromFormat broken when weekday name is followed
|
||||
by some delimiters). (Valentin Logvinskiy, Stas).
|
||||
. Fixed bug #65564 (stack-buffer-overflow in DateTimeZone stuff caught
|
||||
by AddressSanitizer). (Remi).
|
||||
|
||||
- Openssl:
|
||||
. Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
|
||||
some cases). (Mark Jones)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #62129 (rfc1867 crashes php even though turned off). (gxd305 at
|
||||
gmail dot com)
|
||||
. Fixed bug #50308 (session id not appended properly for empty anchor tags).
|
||||
(Arpad)
|
||||
. Fixed possible buffer overflow under Windows. Note: Not a security fix.
|
||||
(Yasuo)
|
||||
. Changed session.auto_start to PHP_INI_PERDIR. (Yasuo)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #65018 (SoapHeader problems with SoapServer). (Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #64953 (Postgres prepared statement positional parameter
|
||||
casting). (Mike)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for
|
||||
some specific contents). (Stas)
|
||||
|
||||
- Pgsql:
|
||||
. Fixed bug #65336 (pg_escape_literal/identifier() silently returns false).
|
||||
(Yasuo)
|
||||
. Fixed bug #62978 (Disallow possible SQL injections with pg_select()/pg_update()
|
||||
/pg_delete()/pg_insert()). (Yasuo)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #65391 (Unable to send vary header user-agent when
|
||||
ob_start('ob_gzhandler') is called) (Mike)
|
||||
|
||||
22 Aug 2013, PHP 5.4.19
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64503 (Compilation fails with error: conflicting types for
|
||||
'zendparse'). (Laruence)
|
||||
|
||||
- Openssl:
|
||||
. Fixed UMR in fix for CVE-2013-4248.
|
||||
. Fixed UMR in fix for CVE-2013-4248.
|
||||
|
||||
15 Aug 2013, PHP 5.4.18
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ zend_module_entry foo_module_entry = {
|
||||
PHP_RSHUTDOWN(foo), /* per-request shutdown function */
|
||||
PHP_MINFO(foo), /* information function */
|
||||
#if ZEND_MODULE_API_NO >= 20010901
|
||||
FOO_VERSION, /* extension version number (string) */
|
||||
PHP_FOO_VERSION, /* extension version number (string) */
|
||||
#endif
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
@@ -31,6 +31,11 @@ HOW TO USE IT
|
||||
|
||||
./buildconf; ./configure --enable-module_name; make
|
||||
|
||||
The definition of PHP_MODULE_NAME_VERSION will be present in the
|
||||
php_module_name.h and injected into the zend_module_entry definition. This
|
||||
is required by the PECL website for the version string conformity checks
|
||||
against package.xml
|
||||
|
||||
But if you already have planned the overall scheme of your module, what
|
||||
functions it will contain, their return types and the arguments they take
|
||||
(a very good idea) and don't want to bother yourself with creating function
|
||||
|
||||
+5
-3
@@ -69,9 +69,11 @@ The next few rules are more of a technical nature::
|
||||
branches) an empty merge should be done.
|
||||
|
||||
2. All news updates intended for public viewing, such as new features,
|
||||
bug fixes, improvements, etc., should go into the NEWS file of the
|
||||
*first* to be released version with the given change. In other words
|
||||
any NEWS file change only needs to done in one branch.
|
||||
bug fixes, improvements, etc., should go into the NEWS file of *any
|
||||
stable release* version with the given change. In other words,
|
||||
news about a bug fix which went into PHP-5.4, PHP-5.5 and master
|
||||
should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but
|
||||
not master, which is not a public released version yet.
|
||||
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
|
||||
+78
-68
@@ -8,15 +8,16 @@ General notes and tips
|
||||
1. Do not release on Fridays, Saturdays or Sundays
|
||||
because the sysadmins can not upgrade stuff then.
|
||||
|
||||
2. Package the day before a release. So if the release is to be on Thursday,
|
||||
package on Wednesday.
|
||||
2. Package two days before a release. So if the release is to be on Thursday,
|
||||
package on Tuesday. Think about timezones as well.
|
||||
|
||||
3. Ensure that Windows builds will work before packaging
|
||||
|
||||
4. Follow all steps to the letter. When unclear ask previous RM's (Derick/Ilia)
|
||||
before proceeding. Ideally make sure that for the first releases one of the
|
||||
previous RM's is around to answer questions. For the steps related to the
|
||||
php/QA/bug websites try to have someone from the webmaster team (Bjori) on hand.
|
||||
4. Follow all steps to the letter. When unclear ask previous RM's (David/Julien/
|
||||
Johannes/Stas/Derick/Ilia) before proceeding. Ideally make sure that for the
|
||||
first releases one of the previous RM's is around to answer questions. For the
|
||||
steps related to the php/QA/bug websites try to have someone from the webmaster
|
||||
team (Bjori) on hand.
|
||||
|
||||
5. Verify the tags to be extra sure everything was tagged properly.
|
||||
|
||||
@@ -50,30 +51,44 @@ Rolling a non stable release (alpha/beta/RC)
|
||||
2. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
credits files in ext/standard.
|
||||
|
||||
3. Checkout the release branch for this release (e.g., PHP-5.4.2).
|
||||
3. Checkout the release branch for this release (e.g., PHP-5.4.2) from the main branch.
|
||||
|
||||
4. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
Do not use abbreviations for alpha and beta.
|
||||
Do not use abbreviations for alpha and beta. Do not use dashes, you should
|
||||
``#define PHP_VERSION "5.4.22RC1"`` and not ``#define PHP_VERSION "5.4.22-RC1"``
|
||||
|
||||
5. Commit these changes to the branch with ``git commit -a``.
|
||||
5. Compile and make test, with and without ZTS, using the right Bison version
|
||||
(for example, for 5.5, Bison 2.4.1 is used)
|
||||
|
||||
6. Tag the repository with the version, e.g.:
|
||||
6. Check ./sapi/cli/php -v output for version matching.
|
||||
|
||||
7. If all is right, commit the changes to the release branch with ``git commit -a``.
|
||||
|
||||
8. Tag the repository release branch with the version, e.g.:
|
||||
``git tag -u YOURKEYID php-5.4.2RC2``
|
||||
|
||||
7. Push the changes to the main repo:
|
||||
9. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and ``NEWS``
|
||||
in the *main* branch (PHP-5.4 for example) to prepare for the **next** version.
|
||||
F.e. if the RC is "5.4.1RC1" then the new one should be "5.4.2-dev" - regardless if we get
|
||||
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
|
||||
Commit the changes to the main branch.
|
||||
|
||||
10. Push the changes to the main repo, the tag, the main branch and the release branch :
|
||||
``git push --tags origin HEAD``
|
||||
``git push origin {main branch}``
|
||||
``git push origin {release branch}``
|
||||
|
||||
8. run: ``./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build two tarballs (one gz and one bz2).
|
||||
11. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
|
||||
9. Copy those two tarballs to www.php.net, in your homedir there should be a
|
||||
12. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
directory "downloads/". Copy them into there, so that the system can generate
|
||||
MD5 sums. If you do not have this directory, talk to Derick.
|
||||
MD5 sums. If you do not have this directory, talk to Derick or Dan.
|
||||
|
||||
10. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
13. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
f.e. http://downloads.php.net/derick/
|
||||
|
||||
11. Once the release has been tagged, contact the PHP Windows development team
|
||||
14. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be placed into the same directory as the source snapshots.
|
||||
|
||||
@@ -105,9 +120,9 @@ Derick) run the following commands for you:
|
||||
|
||||
Note: Remember to update the MD5 checksum information.
|
||||
|
||||
4. Update ``php.git/include/version.inc`` (x=major version number)
|
||||
4. Update ``web/php.git/include/version.inc`` (x=major version number)
|
||||
|
||||
a. ``$PHP_x_RC`` = "5.4.0RC1"
|
||||
a. ``$PHP_x_RC`` = "5.4.0RC1" (should be set to "false" before)
|
||||
|
||||
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
|
||||
|
||||
@@ -118,67 +133,61 @@ Derick) run the following commands for you:
|
||||
6. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
|
||||
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
|
||||
|
||||
7. Publish the announce on www.php.net as well (for all releases, alpha, RCs or other)
|
||||
|
||||
Rolling a stable release
|
||||
------------------------
|
||||
|
||||
1. Check windows snapshot builder logs (http://snaps.php.net/win32/snapshot-STABLE.log f.e.)
|
||||
1. Checkout your release branch, you should have created when releasing previous RC
|
||||
and bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
|
||||
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
2. If a CVE commit needs to be merged to the release, then have it commited to
|
||||
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
|
||||
merge to 5.4, 5.5 etc...). Then you can cherry-pick it in your release branch.
|
||||
Don't forget to update NEWS manually in an extra commit then.
|
||||
|
||||
3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections)
|
||||
3. Commit those changes
|
||||
|
||||
4. Commit those changes
|
||||
|
||||
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
4. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
credits files in ext/standard.
|
||||
|
||||
6. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
|
||||
(of course, you need to change that to the version you're rolling an RC for).
|
||||
When making 5.X release, you need to tag the Zend directory separately!!
|
||||
5. Compile and make test, with and without ZTS, using the right Bison version
|
||||
(for example, for 5.5, Bison 2.4.1 is used)
|
||||
|
||||
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
|
||||
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
|
||||
was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get
|
||||
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
|
||||
6. Check ./sapi/cli/php -v output for version matching.
|
||||
|
||||
8. Commit those changes
|
||||
7. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
|
||||
|
||||
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4
|
||||
branch if you're rolling 5.5.x releases).
|
||||
8. Push the tag f.e. "``git push origin php-5.4.1``"
|
||||
|
||||
10. You do not have to update the tree, but of course you can with "``git pull
|
||||
origin <branch>``".
|
||||
9. run: ``PHPROOT=. ./makedist php 5.4.1``, this will export the tag, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
Check if the pear files are updated (phar).
|
||||
|
||||
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
|
||||
and build two tarballs (one gz and one bz2).
|
||||
10. Generate the GPG signature files for the archives.
|
||||
``gpg -u YOUREMAIL --armor --detach-sign php-X.Y.Z.tar.xxx``
|
||||
|
||||
12. Commit those two tarballs to web/php-distributions.git, then update the git
|
||||
submodule reference in web/php.git:
|
||||
git submodule init;
|
||||
11. Commit and push all the tarballs and signature files to web/php-distributions.git,
|
||||
then update the git submodule reference in web/php.git:
|
||||
``git submodule init;
|
||||
git submodule update;
|
||||
cd distributions;
|
||||
git pull origin master;
|
||||
cd ..;
|
||||
git commit distributions;
|
||||
git push;
|
||||
git push;``
|
||||
This is to fetch the last commit id from php-distributions.git and commit this
|
||||
last commit id to web/php.git, then, mirrors will now sync
|
||||
|
||||
13. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be committed to SVN too.
|
||||
|
||||
14. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4)
|
||||
|
||||
15. When making a final release, also remind the PHP Windows development team
|
||||
(internals-win@lists.php.net) to prepare the installer packages for Win32.
|
||||
12. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created.
|
||||
|
||||
Getting the stable release announced
|
||||
------------------------------------
|
||||
|
||||
1. Run the bumpRelease script for phpweb on your local checkout
|
||||
|
||||
a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4)
|
||||
a. ``php bin/bumpRelease 5`` to create the release file (releases/x_y_z.php)
|
||||
The release announcement file should list in detail security fixes and
|
||||
changes in behavior (whether due to a bug fix or not).
|
||||
|
||||
b. In case multiple PHP minor versions are in active development you have
|
||||
to manually copy the old information to include/releases.inc
|
||||
@@ -198,7 +207,13 @@ Getting the stable release announced
|
||||
|
||||
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
|
||||
|
||||
3. Update the ChangeLog file for the given major version
|
||||
3. Update phpweb/include/releases.php with the old release info
|
||||
(updates the download archives)
|
||||
|
||||
4. Update php-qa/include/release-qa.php and add the next version as an QARELEASE
|
||||
(prepare for next RC)
|
||||
|
||||
5. Update the ChangeLog file for the given major version
|
||||
f.e. ``ChangeLog-5.php`` from the NEWS file
|
||||
|
||||
a. go over the list and put every element on one line
|
||||
@@ -218,19 +233,10 @@ f.e. ``ChangeLog-5.php`` from the NEWS file
|
||||
IV. ``s/Fixed PECL bug #\([0-9]\+\)/<?php peclbugfix(\1); ?>/``
|
||||
|
||||
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
|
||||
|
||||
e. You may want to try php-web/bin/news2html to automate this task
|
||||
|
||||
4. ``cp releases/5_4_0.php releases/5_4_1.php``
|
||||
|
||||
5. ``git add releases/5_4_1.php``
|
||||
|
||||
6. Update the ``releases/*.php`` file with relevant data. The release
|
||||
announcement file should list in detail:
|
||||
|
||||
a. security fixes,
|
||||
|
||||
b. changes in behavior (whether due to a bug fix or not)
|
||||
|
||||
7. Add a short notice to phpweb stating that there is a new release, and
|
||||
6. Add a short notice to phpweb stating that there is a new release, and
|
||||
highlight the major important things (security fixes) and when it is important
|
||||
to upgrade.
|
||||
|
||||
@@ -238,7 +244,11 @@ to upgrade.
|
||||
|
||||
b. Add the content for the news entry
|
||||
|
||||
8. Commit all the changes.
|
||||
7. **Check mirrors have been synced before announcing or pushing news**
|
||||
Try, f.e. http://www.php.net/get/php-5.5.1.tar.bz2/from/a/mirror
|
||||
Try several mirrors, mirrors may update slowly (may take an hour)
|
||||
|
||||
8. Commit all the changes to their respective git repos
|
||||
|
||||
9. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
|
||||
@@ -153,3 +153,18 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
|
||||
#ifdef COMPILE_DL_FOO
|
||||
ZEND_GET_MODULE(foo)
|
||||
#endif
|
||||
|
||||
PECL SITE CONFORMITY
|
||||
|
||||
If you plan to release an extension to the PECL website, there are several
|
||||
points to be regarded.
|
||||
|
||||
1. Add LICENSE or COPYING to the package.xml
|
||||
|
||||
2. The following should be defined in one of the extension header files
|
||||
|
||||
#define PHP_FOO_VERSION "1.2.3"
|
||||
|
||||
This macros has to be used within your foo_module_entry to indicate the
|
||||
extension version.
|
||||
|
||||
+5
-3
@@ -625,7 +625,7 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
shm->info = info_handle;
|
||||
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
if (created) {
|
||||
if (NULL != shm->descriptor && created) {
|
||||
shm->descriptor->shm_perm.key = key;
|
||||
shm->descriptor->shm_segsz = size;
|
||||
shm->descriptor->shm_ctime = time(NULL);
|
||||
@@ -639,8 +639,10 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0;
|
||||
}
|
||||
|
||||
if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) {
|
||||
CloseHandle(shm->segment);
|
||||
if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) {
|
||||
if (NULL != shm->segment) {
|
||||
CloseHandle(shm->segment);
|
||||
}
|
||||
UnmapViewOfFile(shm->descriptor);
|
||||
CloseHandle(shm->info);
|
||||
return -1;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ libZend_la_SOURCES=\
|
||||
zend_ini_parser.y zend_ini_scanner.l \
|
||||
zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \
|
||||
zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \
|
||||
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
|
||||
zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
|
||||
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
|
||||
zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \
|
||||
|
||||
@@ -257,6 +257,10 @@ SOURCE=.\zend_ts_hash.c
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_vm_opcodes.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
|
||||
@@ -287,6 +287,10 @@ SOURCE=.\zend_ts_hash.c
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_vm_opcodes.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
bison_version=none
|
||||
if test "$YACC"; then
|
||||
AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
|
||||
bison_version_vars=`bison --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /' | tr -d a-z`
|
||||
bison_version_vars=`$YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /g' | tr -d a-z`
|
||||
php_cv_bison_version=invalid
|
||||
if test -n "$bison_version_vars"; then
|
||||
set $bison_version_vars
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #60598 (cli/apache sapi segfault on objects manipulation)
|
||||
--FILE--
|
||||
<?php
|
||||
define('OBJECT_COUNT', 10000);
|
||||
|
||||
$containers = array();
|
||||
|
||||
class Object {
|
||||
protected $_guid = 0;
|
||||
public function __construct() {
|
||||
global $containers;
|
||||
$this->guid = 1;
|
||||
$containers[spl_object_hash($this)] = $this;
|
||||
}
|
||||
public function __destruct() {
|
||||
global $containers;
|
||||
$containers[spl_object_hash($this)] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < OBJECT_COUNT; ++$i) {
|
||||
new Object();
|
||||
}
|
||||
|
||||
// You probably won't see this because of the "zend_mm_heap corrupted"
|
||||
?>
|
||||
If you see this, try to increase OBJECT_COUNT to 100,000
|
||||
--EXPECT--
|
||||
If you see this, try to increase OBJECT_COUNT to 100,000
|
||||
+10
-10
@@ -1,10 +1,10 @@
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('./test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
|
||||
--XFAIL--
|
||||
We can not fix this bug without a significant (performace slow down) change to gc
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
class bad
|
||||
{
|
||||
private $_private = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_private[] = 'php';
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
global $bar;
|
||||
$bar = $this;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new stdclass;
|
||||
$foo->foo = $foo;
|
||||
$foo->bad = new bad;
|
||||
|
||||
gc_disable();
|
||||
|
||||
unserialize(serialize($foo));
|
||||
gc_collect_cycles();
|
||||
var_dump($bar);
|
||||
/* will output:
|
||||
object(bad)#4 (1) {
|
||||
["_private":"bad":private]=>
|
||||
&UNKNOWN:0
|
||||
}
|
||||
*/
|
||||
?>
|
||||
--EXPECTF--
|
||||
bject(bad)#%d (1) {
|
||||
["_private":"bad":private]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "php"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #65291 - get_defined_constants() causes PHP to crash in a very limited case.
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public static function testStaticFunction()
|
||||
{
|
||||
return __CLASS__;
|
||||
}
|
||||
}
|
||||
class Tester
|
||||
{
|
||||
use TestTrait;
|
||||
}
|
||||
|
||||
$foo = Tester::testStaticFunction();
|
||||
get_defined_constants();
|
||||
get_defined_constants(true);
|
||||
|
||||
echo $foo;
|
||||
?>
|
||||
--EXPECT--
|
||||
Tester
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #65322: compile time errors won't trigger auto loading
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($class) {
|
||||
var_dump($class);
|
||||
class B {}
|
||||
});
|
||||
|
||||
set_error_handler(function($_, $msg, $file) {
|
||||
var_dump($msg, $file);
|
||||
new B;
|
||||
});
|
||||
|
||||
eval('class A { function a() {} function __construct() {} }');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(50) "Redefining already defined constructor for class A"
|
||||
string(%d) "%s(%d) : eval()'d code"
|
||||
string(1) "B"
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ParentClass
|
||||
{
|
||||
private static $_OBJECTS;
|
||||
|
||||
public static function Get()
|
||||
{
|
||||
self::$_OBJECTS[1] = new ChildClass();
|
||||
return self::$_OBJECTS[1];
|
||||
}
|
||||
}
|
||||
|
||||
class ChildClass extends ParentClass
|
||||
{
|
||||
public $Manager;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->Manager = $this;
|
||||
}
|
||||
|
||||
public static function &GetCurrent()
|
||||
{
|
||||
return ChildClass::Get();
|
||||
}
|
||||
|
||||
public static function &Get()
|
||||
{
|
||||
return parent::Get();
|
||||
}
|
||||
}
|
||||
|
||||
$staff = ChildClass::GetCurrent();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variable references should be returned by reference in %sbug65372.php on line 30
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #65579 (Using traits with get_class_methods causes segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
trait ParentTrait {
|
||||
public function testMethod() { }
|
||||
}
|
||||
|
||||
trait ChildTrait {
|
||||
use ParentTrait {
|
||||
testMethod as testMethodFromParentTrait;
|
||||
}
|
||||
public function testMethod() { }
|
||||
}
|
||||
|
||||
class TestClass {
|
||||
use ChildTrait;
|
||||
}
|
||||
|
||||
$obj = new TestClass();
|
||||
var_dump(get_class_methods($obj));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(10) "testMethod"
|
||||
[1]=>
|
||||
string(25) "testmethodfromparenttrait"
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #65911 (scope resolution operator - strange behavior with $this)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {}
|
||||
|
||||
class B
|
||||
{
|
||||
public function go()
|
||||
{
|
||||
$this->foo = 'bar';
|
||||
echo A::$this->foo; // should not output 'bar'
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new B();
|
||||
$obj->go();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: A::$this in %s on line %d
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #65969 (Chain assignment with T_LIST failure)
|
||||
--FILE--
|
||||
<?php
|
||||
$obj = new stdClass;
|
||||
list($a,$b) = $obj->prop = [1,2];
|
||||
var_dump($a,$b);
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #66218 zend_register_functions breaks reflection
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_SAPI != "cli") die("skip CLI only test");
|
||||
if (!function_exists("dl")) die("skip need dl");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$tab = get_extension_funcs("standard");
|
||||
$fcts = array("dl");
|
||||
foreach ($fcts as $fct) {
|
||||
if (in_array($fct, $tab)) {
|
||||
echo "$fct Ok\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
dl Ok
|
||||
Done
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Error message in error handler during compilation
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($_, $msg, $file) {
|
||||
var_dump($msg, $file);
|
||||
echo $undefined;
|
||||
});
|
||||
|
||||
eval('class A { function a() {} function __construct() {} }');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(50) "Redefining already defined constructor for class A"
|
||||
string(%d) "%s(%d) : eval()'d code"
|
||||
|
||||
Notice: Undefined variable: undefined in %s on line %d
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Overridding Conflicting Methods should not result in a notice/warning about collisions
|
||||
Overriding Conflicting Methods should not result in a notice/warning about collisions
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
+8
-8
@@ -43,10 +43,6 @@
|
||||
# define GLOBAL_CONSTANTS_TABLE EG(zend_constants)
|
||||
#endif
|
||||
|
||||
#if defined(ZEND_WIN32) && ZEND_DEBUG
|
||||
BOOL WINAPI IsDebuggerPresent(VOID);
|
||||
#endif
|
||||
|
||||
/* true multithread-shared globals */
|
||||
ZEND_API zend_class_entry *zend_standard_class_def = NULL;
|
||||
ZEND_API int (*zend_printf)(const char *format, ...);
|
||||
@@ -1091,17 +1087,19 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
error_filename = "Unknown";
|
||||
}
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if(DTRACE_ERROR_ENABLED()) {
|
||||
char *dtrace_error_buffer;
|
||||
va_start(args, format);
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
|
||||
DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);
|
||||
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
|
||||
efree(dtrace_error_buffer);
|
||||
va_end(args);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
/* if we don't have a user defined error handler */
|
||||
if (!EG(user_error_handler)
|
||||
|| !(EG(user_error_handler_error_reporting) & type)
|
||||
@@ -1181,7 +1179,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
* such scripts recursivly, but some CG() variables may be
|
||||
* inconsistent. */
|
||||
|
||||
in_compilation = zend_is_compiling(TSRMLS_C);
|
||||
in_compilation = CG(in_compilation);
|
||||
if (in_compilation) {
|
||||
saved_class_entry = CG(active_class_entry);
|
||||
CG(active_class_entry) = NULL;
|
||||
@@ -1193,6 +1191,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
SAVE_STACK(declare_stack);
|
||||
SAVE_STACK(list_stack);
|
||||
SAVE_STACK(context_stack);
|
||||
CG(in_compilation) = 0;
|
||||
}
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
|
||||
@@ -1217,6 +1216,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
RESTORE_STACK(declare_stack);
|
||||
RESTORE_STACK(list_stack);
|
||||
RESTORE_STACK(context_stack);
|
||||
CG(in_compilation) = 1;
|
||||
}
|
||||
|
||||
if (!EG(user_error_handler)) {
|
||||
|
||||
+15
-9
@@ -2514,7 +2514,12 @@ ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_c
|
||||
char *lcname = zend_str_tolower_dup(name, name_len);
|
||||
int ret;
|
||||
|
||||
ret = zend_hash_add(CG(class_table), lcname, name_len+1, &ce, sizeof(zend_class_entry *), NULL);
|
||||
if (lcname[0] == '\\') {
|
||||
ret = zend_hash_add(CG(class_table), lcname+1, name_len, &ce, sizeof(zend_class_entry *), NULL);
|
||||
} else {
|
||||
ret = zend_hash_add(CG(class_table), lcname, name_len+1, &ce, sizeof(zend_class_entry *), NULL);
|
||||
}
|
||||
|
||||
efree(lcname);
|
||||
if (ret == SUCCESS) {
|
||||
ce->refcount++;
|
||||
@@ -3917,15 +3922,16 @@ ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name
|
||||
{
|
||||
zend_trait_alias *alias, **alias_ptr;
|
||||
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
if ((alias_ptr = ce->trait_aliases)) {
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
|
||||
@@ -1399,15 +1399,8 @@ ZEND_FUNCTION(class_alias)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!autoload) {
|
||||
lc_name = do_alloca(class_name_len + 1, use_heap);
|
||||
zend_str_tolower_copy(lc_name, class_name, class_name_len);
|
||||
found = zend_lookup_class_ex(class_name, class_name_len, NULL, autoload, &ce TSRMLS_CC);
|
||||
|
||||
found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce);
|
||||
free_alloca(lc_name, use_heap);
|
||||
} else {
|
||||
found = zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC);
|
||||
}
|
||||
if (found == SUCCESS) {
|
||||
if ((*ce)->type == ZEND_USER_CLASS) {
|
||||
if (zend_register_class_alias_ex(alias_name, alias_name_len, *ce TSRMLS_CC) == SUCCESS) {
|
||||
@@ -1926,6 +1919,11 @@ static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC)
|
||||
zval *name_array = (zval *)arg;
|
||||
zval *const_val;
|
||||
|
||||
if (!constant->name) {
|
||||
/* skip special constants */
|
||||
return 0;
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(const_val);
|
||||
*const_val = constant->value;
|
||||
zval_copy_ctor(const_val);
|
||||
@@ -1993,11 +1991,16 @@ ZEND_FUNCTION(get_defined_constants)
|
||||
while (zend_hash_get_current_data_ex(EG(zend_constants), (void **) &val, &pos) != FAILURE) {
|
||||
zval *const_val;
|
||||
|
||||
if (!val->name) {
|
||||
/* skip special constants */
|
||||
goto next_constant;
|
||||
}
|
||||
|
||||
if (val->module_number == PHP_USER_CONSTANT) {
|
||||
module_number = i;
|
||||
} else if (val->module_number > i || val->module_number < 0) {
|
||||
/* should not happen */
|
||||
goto bad_module_id;
|
||||
goto next_constant;
|
||||
} else {
|
||||
module_number = val->module_number;
|
||||
}
|
||||
@@ -2014,7 +2017,7 @@ ZEND_FUNCTION(get_defined_constants)
|
||||
INIT_PZVAL(const_val);
|
||||
|
||||
add_assoc_zval_ex(modules[module_number], val->name, val->name_len, const_val);
|
||||
bad_module_id:
|
||||
next_constant:
|
||||
zend_hash_move_forward_ex(EG(zend_constants), &pos);
|
||||
}
|
||||
efree(module_names);
|
||||
@@ -2386,7 +2389,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
MAKE_STD_ZVAL(arg_array);
|
||||
array_init(arg_array);
|
||||
|
||||
/* include_filename always points to the last filename of the last last called-fuction.
|
||||
/* include_filename always points to the last filename of the last last called-function.
|
||||
if we have called include in the frame above - this is the file we have included.
|
||||
*/
|
||||
|
||||
@@ -2449,36 +2452,49 @@ ZEND_FUNCTION(extension_loaded)
|
||||
Returns an array with the names of functions belonging to the named extension */
|
||||
ZEND_FUNCTION(get_extension_funcs)
|
||||
{
|
||||
char *extension_name;
|
||||
int extension_name_len;
|
||||
char *extension_name, *lcname;
|
||||
int extension_name_len, array;
|
||||
zend_module_entry *module;
|
||||
const zend_function_entry *func;
|
||||
|
||||
HashPosition iterator;
|
||||
zend_function *zif;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &extension_name, &extension_name_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (strncasecmp(extension_name, "zend", sizeof("zend"))) {
|
||||
char *lcname = zend_str_tolower_dup(extension_name, extension_name_len);
|
||||
if (zend_hash_find(&module_registry, lcname,
|
||||
extension_name_len+1, (void**)&module) == FAILURE) {
|
||||
efree(lcname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
efree(lcname);
|
||||
|
||||
if (!(func = module->functions)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
lcname = zend_str_tolower_dup(extension_name, extension_name_len);
|
||||
} else {
|
||||
func = builtin_functions;
|
||||
lcname = estrdup("core");
|
||||
}
|
||||
if (zend_hash_find(&module_registry, lcname,
|
||||
extension_name_len+1, (void**)&module) == FAILURE) {
|
||||
efree(lcname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_internal_pointer_reset_ex(CG(function_table), &iterator);
|
||||
if (module->functions) {
|
||||
/* avoid BC break, if functions list is empty, will return an empty array */
|
||||
array_init(return_value);
|
||||
array = 1;
|
||||
} else {
|
||||
array = 0;
|
||||
}
|
||||
while (zend_hash_get_current_data_ex(CG(function_table), (void **) &zif, &iterator) == SUCCESS) {
|
||||
if (zif->common.type==ZEND_INTERNAL_FUNCTION
|
||||
&& zif->internal_function.module == module) {
|
||||
if (!array) {
|
||||
array_init(return_value);
|
||||
array = 1;
|
||||
}
|
||||
add_next_index_string(return_value, zif->common.function_name, 1);
|
||||
}
|
||||
zend_hash_move_forward_ex(CG(function_table), &iterator);
|
||||
}
|
||||
|
||||
while (func->fname) {
|
||||
add_next_index_string(return_value, func->fname, 1);
|
||||
func++;
|
||||
efree(lcname);
|
||||
|
||||
if (!array) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+4
-3
@@ -905,6 +905,7 @@ static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((opline->opcode == ZEND_FETCH_W) && (opline->op1_type == IS_CONST)
|
||||
&& (Z_TYPE(CONSTANT(opline->op1.constant)) == IS_STRING)
|
||||
&& ((opline->extended_value & ZEND_FETCH_STATIC_MEMBER) != ZEND_FETCH_STATIC_MEMBER)
|
||||
&& (Z_HASH_P(&CONSTANT(opline->op1.constant)) == THIS_HASHVAL)
|
||||
&& (Z_STRLEN(CONSTANT(opline->op1.constant)) == (sizeof("this")-1))
|
||||
&& !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this"))) {
|
||||
@@ -1723,7 +1724,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
}
|
||||
|
||||
{
|
||||
/* Push a seperator to the switch and foreach stacks */
|
||||
/* Push a separator to the switch and foreach stacks */
|
||||
zend_switch_entry switch_entry;
|
||||
|
||||
switch_entry.cond.op_type = IS_UNUSED;
|
||||
@@ -1817,7 +1818,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /*
|
||||
CG(active_op_array) = function_token->u.op_array;
|
||||
|
||||
|
||||
/* Pop the switch and foreach seperators */
|
||||
/* Pop the switch and foreach separators */
|
||||
zend_stack_del_top(&CG(switch_cond_stack));
|
||||
zend_stack_del_top(&CG(foreach_copy_stack));
|
||||
}
|
||||
@@ -2584,7 +2585,7 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /*
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
/* If we reach the seperator then stop applying the stack */
|
||||
/* If we reach the separator then stop applying the stack */
|
||||
if (foreach_copy->result_type == IS_UNUSED && foreach_copy->op1_type == IS_UNUSED) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
+11
-13
@@ -24,7 +24,7 @@
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
/* PHP DTrace probes {{{ */
|
||||
static inline char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
static inline const char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
{
|
||||
if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
|
||||
return EG(current_execute_data)->op_array->filename;
|
||||
@@ -36,9 +36,9 @@ static inline char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
|
||||
{
|
||||
zend_op_array *res;
|
||||
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, file_handle->filename);
|
||||
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, (char *)file_handle->filename);
|
||||
res = compile_file(file_handle, type TSRMLS_CC);
|
||||
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, file_handle->filename);
|
||||
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, (char *)file_handle->filename);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int t
|
||||
ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)
|
||||
{
|
||||
int lineno;
|
||||
char *scope, *filename, *funcname, *classname;
|
||||
const char *scope, *filename, *funcname, *classname;
|
||||
scope = filename = funcname = classname = NULL;
|
||||
|
||||
/* we need filename and lineno for both execute and function probes */
|
||||
@@ -58,48 +58,46 @@ ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)
|
||||
}
|
||||
|
||||
if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {
|
||||
filename = dtrace_get_executed_filename(TSRMLS_C);
|
||||
classname = get_active_class_name(&scope TSRMLS_CC);
|
||||
funcname = get_active_function_name(TSRMLS_C);
|
||||
lineno = zend_get_executed_lineno(TSRMLS_C);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
|
||||
DTRACE_EXECUTE_ENTRY(filename, lineno);
|
||||
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
|
||||
}
|
||||
|
||||
if (DTRACE_FUNCTION_ENTRY_ENABLED() && funcname != NULL) {
|
||||
DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope);
|
||||
DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
|
||||
}
|
||||
|
||||
execute(op_array TSRMLS_CC);
|
||||
|
||||
if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname != NULL) {
|
||||
DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope);
|
||||
DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
DTRACE_EXECUTE_RETURN(filename, lineno);
|
||||
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC)
|
||||
{
|
||||
int lineno;
|
||||
char *filename;
|
||||
const char *filename;
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
filename = dtrace_get_executed_filename(TSRMLS_C);
|
||||
lineno = zend_get_executed_lineno(TSRMLS_C);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
|
||||
DTRACE_EXECUTE_ENTRY(filename, lineno);
|
||||
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
|
||||
}
|
||||
|
||||
execute_internal(execute_data_ptr, return_value_used TSRMLS_CC);
|
||||
|
||||
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
DTRACE_EXECUTE_RETURN(filename, lineno);
|
||||
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,12 +85,12 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
|
||||
char *classname;
|
||||
int name_len;
|
||||
const char *classname;
|
||||
zend_uint name_len;
|
||||
|
||||
if (exception != NULL) {
|
||||
zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC);
|
||||
DTRACE_EXCEPTION_THROWN(classname);
|
||||
DTRACE_EXCEPTION_THROWN((char *)classname);
|
||||
} else {
|
||||
DTRACE_EXCEPTION_THROWN(NULL);
|
||||
}
|
||||
|
||||
+1
-2
@@ -1248,9 +1248,8 @@ convert_to_array:
|
||||
}
|
||||
}
|
||||
|
||||
static void zend_fetch_dimension_address_read(temp_variable *result, zval **container_ptr, zval *dim, int dim_type, int type TSRMLS_DC)
|
||||
static void zend_fetch_dimension_address_read(temp_variable *result, zval *container, zval *dim, int dim_type, int type TSRMLS_DC)
|
||||
{
|
||||
zval *container = *container_ptr;
|
||||
zval **retval;
|
||||
|
||||
switch (Z_TYPE_P(container)) {
|
||||
|
||||
@@ -1072,7 +1072,7 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_
|
||||
}
|
||||
|
||||
/* The compiler is not-reentrant. Make sure we __autoload() only during run-time
|
||||
* (doesn't impact fuctionality of __autoload()
|
||||
* (doesn't impact functionality of __autoload()
|
||||
*/
|
||||
if (!use_autoload || zend_is_compiling(TSRMLS_C)) {
|
||||
if (!key) {
|
||||
@@ -1081,6 +1081,14 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
/* Verify class name before passing it to __autoload() */
|
||||
if (strspn(name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\\") != name_length) {
|
||||
if (!key) {
|
||||
free_alloca(lc_free, use_heap);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (EG(in_autoload) == NULL) {
|
||||
ALLOC_HASHTABLE(EG(in_autoload));
|
||||
zend_hash_init(EG(in_autoload), 0, NULL, NULL, 0);
|
||||
|
||||
+1
-1
@@ -306,7 +306,7 @@ struct _zend_php_scanner_globals {
|
||||
unsigned char *script_filtered;
|
||||
size_t script_filtered_size;
|
||||
|
||||
/* input/ouput filters */
|
||||
/* input/output filters */
|
||||
zend_encoding_filter input_filter;
|
||||
zend_encoding_filter output_filter;
|
||||
const zend_encoding *script_encoding;
|
||||
|
||||
@@ -44,7 +44,7 @@ typedef struct _zend_lex_state {
|
||||
unsigned char *script_filtered;
|
||||
size_t script_filtered_size;
|
||||
|
||||
/* input/ouput filters */
|
||||
/* input/output filters */
|
||||
zend_encoding_filter input_filter;
|
||||
zend_encoding_filter output_filter;
|
||||
const zend_encoding *script_encoding;
|
||||
|
||||
@@ -57,6 +57,11 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
|
||||
obj->dtor(obj->object, i TSRMLS_CC);
|
||||
obj = &objects->object_buckets[i].bucket.obj;
|
||||
obj->refcount--;
|
||||
|
||||
if (obj->refcount == 0) {
|
||||
/* in case gc_collect_cycle is triggered before free_storage */
|
||||
GC_REMOVE_ZOBJ_FROM_BUFFER(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -593,13 +593,18 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
|
||||
"r"(op2)
|
||||
: "rax");
|
||||
#else
|
||||
Z_LVAL_P(result) = Z_LVAL_P(op1) + Z_LVAL_P(op2);
|
||||
/*
|
||||
* 'result' may alias with op1 or op2, so we need to
|
||||
* ensure that 'result' is not updated until after we
|
||||
* have read the values of op1 and op2.
|
||||
*/
|
||||
|
||||
if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
|
||||
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) {
|
||||
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != ((Z_LVAL_P(op1) + Z_LVAL_P(op2)) & LONG_SIGN_MASK))) {
|
||||
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
} else {
|
||||
Z_LVAL_P(result) = Z_LVAL_P(op1) + Z_LVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_LONG;
|
||||
}
|
||||
#endif
|
||||
@@ -736,6 +741,7 @@ static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *o
|
||||
|
||||
static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
#if 0
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && 0) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
@@ -790,6 +796,7 @@ static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *o
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return div_function(result, op1, op2 TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -267,8 +267,7 @@ BEGIN_EXTERN_C()
|
||||
|
||||
#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \
|
||||
defined(IBM) != 1
|
||||
Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or
|
||||
IBM should be defined.
|
||||
#error "Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or IBM should be defined."
|
||||
#endif
|
||||
|
||||
typedef union {
|
||||
|
||||
+24
-19
@@ -1166,19 +1166,17 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
OP1_TYPE != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (OP1_TYPE == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R);
|
||||
container = GET_OP1_ZVAL_PTR(BP_VAR_R);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC);
|
||||
FREE_OP2();
|
||||
FREE_OP1_VAR_PTR();
|
||||
FREE_OP1();
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -1243,13 +1241,13 @@ ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, VAR|CV, CONST|TMP|VAR|CV)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_IS);
|
||||
container = GET_OP1_ZVAL_PTR(BP_VAR_IS);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_IS TSRMLS_CC);
|
||||
FREE_OP2();
|
||||
FREE_OP1_VAR_PTR();
|
||||
FREE_OP1();
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -1258,12 +1256,12 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -1271,15 +1269,19 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
|
||||
if (OP1_TYPE == IS_VAR && OP1_FREE && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
FREE_OP2();
|
||||
FREE_OP1_VAR_PTR();
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (OP2_TYPE == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R);
|
||||
container = GET_OP1_ZVAL_PTR(BP_VAR_R);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC);
|
||||
FREE_OP2();
|
||||
FREE_OP1();
|
||||
}
|
||||
FREE_OP2();
|
||||
FREE_OP1_VAR_PTR();
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -2910,9 +2912,12 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2981,7 +2986,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
|
||||
DTRACE_EXCEPTION_CAUGHT(ce->name);
|
||||
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
|
||||
+163
-127
@@ -2324,9 +2324,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -6276,7 +6279,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
|
||||
DTRACE_EXCEPTION_CAUGHT(ce->name);
|
||||
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
@@ -6743,9 +6746,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -11055,9 +11061,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -12865,16 +12874,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
IS_VAR != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
@@ -12942,10 +12949,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC);
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
@@ -12957,12 +12964,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -12970,15 +12977,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_CONST == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -15039,16 +15050,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
IS_VAR != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
|
||||
zval_dtor(free_op2.var);
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
@@ -15116,10 +15125,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC);
|
||||
zval_dtor(free_op2.var);
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
@@ -15131,12 +15140,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -15144,15 +15153,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
zval_dtor(free_op2.var);
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_TMP_VAR == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
|
||||
zval_dtor(free_op2.var);
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
}
|
||||
zval_dtor(free_op2.var);
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -17123,16 +17136,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
IS_VAR != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
@@ -17200,10 +17211,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC);
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
@@ -17215,12 +17226,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -17228,15 +17239,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_VAR == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
}
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -18998,12 +19013,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -19011,15 +19026,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_UNUSED == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -20248,16 +20267,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
IS_VAR != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
@@ -20325,10 +20342,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC);
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
@@ -20340,12 +20357,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -20353,15 +20370,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
|
||||
if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_CV == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -27030,9 +27051,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -28680,16 +28704,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
IS_CV != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -28756,10 +28778,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -28771,12 +28793,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -28784,15 +28806,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
|
||||
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_CONST == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -30629,16 +30655,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
IS_CV != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
|
||||
zval_dtor(free_op2.var);
|
||||
|
||||
@@ -30705,10 +30729,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC);
|
||||
zval_dtor(free_op2.var);
|
||||
|
||||
@@ -30720,12 +30744,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -30733,15 +30757,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD
|
||||
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
zval_dtor(free_op2.var);
|
||||
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_TMP_VAR == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
|
||||
}
|
||||
zval_dtor(free_op2.var);
|
||||
zval_dtor(free_op2.var);
|
||||
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -32582,16 +32610,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
IS_CV != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
|
||||
@@ -32658,10 +32684,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC);
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
|
||||
@@ -32673,12 +32699,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -32686,15 +32712,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD
|
||||
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_VAR == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
|
||||
}
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
|
||||
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -34324,12 +34354,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -34337,15 +34367,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP
|
||||
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_UNUSED == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
@@ -35434,16 +35468,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
|
||||
IS_CV != IS_CV &&
|
||||
EX_T(opline->op1.var).var.ptr_ptr) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(EX_T(opline->op1.var).var.ptr);
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -35510,10 +35542,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
zval **container;
|
||||
zval *container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -35525,12 +35557,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval **container;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
@@ -35538,15 +35570,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
|
||||
if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) {
|
||||
EXTRACT_ZVAL_PTR(&EX_T(opline->result.var));
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
zval *container;
|
||||
|
||||
if (IS_CV == IS_UNUSED) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
+36
-3
@@ -886,9 +886,16 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
|
||||
out($f,"#undef CHECK_EXCEPTION\n");
|
||||
out($f,"#undef HANDLE_EXCEPTION\n");
|
||||
out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
|
||||
out($f,"#define CHECK_EXCEPTION() if (UNEXPECTED(EG(exception) != NULL)) goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
|
||||
out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
|
||||
out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
|
||||
if (ZEND_VM_SPEC) {
|
||||
out($f,"#define CHECK_EXCEPTION() if (UNEXPECTED(EG(exception) != NULL)) goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
|
||||
out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
|
||||
out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
|
||||
} else {
|
||||
out($f,"#define CHECK_EXCEPTION() if (UNEXPECTED(EG(exception) != NULL)) goto ZEND_HANDLE_EXCEPTION_HANDLER\n");
|
||||
out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_HANDLER\n");
|
||||
out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_HANDLER\n");
|
||||
}
|
||||
|
||||
out($f,"#define LOAD_REGS() do {Ts = EX(Ts); CVs = EX(CVs);} while (0)\n");
|
||||
out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
|
||||
out($f,"#define ZEND_VM_RETURN() EG(in_execution) = original_in_execution; return\n");
|
||||
@@ -1194,14 +1201,40 @@ function gen_vm($def, $skel) {
|
||||
// Insert header
|
||||
out($f, $GLOBALS['header_text']);
|
||||
|
||||
fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n");
|
||||
fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n");
|
||||
|
||||
foreach ($opcodes as $code => $dsc) {
|
||||
$code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT);
|
||||
$op = str_pad($dsc["op"],$max_opcode_len);
|
||||
fputs($f,"#define $op $code\n");
|
||||
}
|
||||
|
||||
fputs($f, "\n#endif");
|
||||
fclose($f);
|
||||
echo "zend_vm_opcodes.h generated successfully.\n";
|
||||
|
||||
// zend_vm_opcodes.c
|
||||
$f = fopen("zend_vm_opcodes.c", "w+") or die("ERROR: Cannot create zend_vm_opcodes.c\n");
|
||||
|
||||
// Insert header
|
||||
out($f, $GLOBALS['header_text']);
|
||||
fputs($f,"#include <stdio.h>\n");
|
||||
fputs($f,"#include <zend.h>\n\n");
|
||||
|
||||
fputs($f,"const char *zend_vm_opcodes_map[".($max_opcode + 1)."] = {\n");
|
||||
for ($i = 0; $i <= $max_opcode; $i++) {
|
||||
fputs($f,"\t".(isset($opcodes[$i]["op"])?'"'.$opcodes[$i]["op"].'"':"NULL").",\n");
|
||||
}
|
||||
fputs($f, "};\n\n");
|
||||
|
||||
fputs($f, "ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {\n");
|
||||
fputs($f, "\treturn zend_vm_opcodes_map[opcode];\n");
|
||||
fputs($f, "}\n");
|
||||
|
||||
fclose($f);
|
||||
echo "zend_vm_opcodes.c generated successfully.\n";
|
||||
|
||||
// Generate zend_vm_execute.h
|
||||
$f = fopen("zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n");
|
||||
$executor_file = realpath("zend_vm_execute.h");
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2013 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 |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
| Dmitry Stogov <dmitry@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <zend.h>
|
||||
|
||||
const char *zend_vm_opcodes_map[159] = {
|
||||
"ZEND_NOP",
|
||||
"ZEND_ADD",
|
||||
"ZEND_SUB",
|
||||
"ZEND_MUL",
|
||||
"ZEND_DIV",
|
||||
"ZEND_MOD",
|
||||
"ZEND_SL",
|
||||
"ZEND_SR",
|
||||
"ZEND_CONCAT",
|
||||
"ZEND_BW_OR",
|
||||
"ZEND_BW_AND",
|
||||
"ZEND_BW_XOR",
|
||||
"ZEND_BW_NOT",
|
||||
"ZEND_BOOL_NOT",
|
||||
"ZEND_BOOL_XOR",
|
||||
"ZEND_IS_IDENTICAL",
|
||||
"ZEND_IS_NOT_IDENTICAL",
|
||||
"ZEND_IS_EQUAL",
|
||||
"ZEND_IS_NOT_EQUAL",
|
||||
"ZEND_IS_SMALLER",
|
||||
"ZEND_IS_SMALLER_OR_EQUAL",
|
||||
"ZEND_CAST",
|
||||
"ZEND_QM_ASSIGN",
|
||||
"ZEND_ASSIGN_ADD",
|
||||
"ZEND_ASSIGN_SUB",
|
||||
"ZEND_ASSIGN_MUL",
|
||||
"ZEND_ASSIGN_DIV",
|
||||
"ZEND_ASSIGN_MOD",
|
||||
"ZEND_ASSIGN_SL",
|
||||
"ZEND_ASSIGN_SR",
|
||||
"ZEND_ASSIGN_CONCAT",
|
||||
"ZEND_ASSIGN_BW_OR",
|
||||
"ZEND_ASSIGN_BW_AND",
|
||||
"ZEND_ASSIGN_BW_XOR",
|
||||
"ZEND_PRE_INC",
|
||||
"ZEND_PRE_DEC",
|
||||
"ZEND_POST_INC",
|
||||
"ZEND_POST_DEC",
|
||||
"ZEND_ASSIGN",
|
||||
"ZEND_ASSIGN_REF",
|
||||
"ZEND_ECHO",
|
||||
"ZEND_PRINT",
|
||||
"ZEND_JMP",
|
||||
"ZEND_JMPZ",
|
||||
"ZEND_JMPNZ",
|
||||
"ZEND_JMPZNZ",
|
||||
"ZEND_JMPZ_EX",
|
||||
"ZEND_JMPNZ_EX",
|
||||
"ZEND_CASE",
|
||||
"ZEND_SWITCH_FREE",
|
||||
"ZEND_BRK",
|
||||
"ZEND_CONT",
|
||||
"ZEND_BOOL",
|
||||
"ZEND_INIT_STRING",
|
||||
"ZEND_ADD_CHAR",
|
||||
"ZEND_ADD_STRING",
|
||||
"ZEND_ADD_VAR",
|
||||
"ZEND_BEGIN_SILENCE",
|
||||
"ZEND_END_SILENCE",
|
||||
"ZEND_INIT_FCALL_BY_NAME",
|
||||
"ZEND_DO_FCALL",
|
||||
"ZEND_DO_FCALL_BY_NAME",
|
||||
"ZEND_RETURN",
|
||||
"ZEND_RECV",
|
||||
"ZEND_RECV_INIT",
|
||||
"ZEND_SEND_VAL",
|
||||
"ZEND_SEND_VAR",
|
||||
"ZEND_SEND_REF",
|
||||
"ZEND_NEW",
|
||||
"ZEND_INIT_NS_FCALL_BY_NAME",
|
||||
"ZEND_FREE",
|
||||
"ZEND_INIT_ARRAY",
|
||||
"ZEND_ADD_ARRAY_ELEMENT",
|
||||
"ZEND_INCLUDE_OR_EVAL",
|
||||
"ZEND_UNSET_VAR",
|
||||
"ZEND_UNSET_DIM",
|
||||
"ZEND_UNSET_OBJ",
|
||||
"ZEND_FE_RESET",
|
||||
"ZEND_FE_FETCH",
|
||||
"ZEND_EXIT",
|
||||
"ZEND_FETCH_R",
|
||||
"ZEND_FETCH_DIM_R",
|
||||
"ZEND_FETCH_OBJ_R",
|
||||
"ZEND_FETCH_W",
|
||||
"ZEND_FETCH_DIM_W",
|
||||
"ZEND_FETCH_OBJ_W",
|
||||
"ZEND_FETCH_RW",
|
||||
"ZEND_FETCH_DIM_RW",
|
||||
"ZEND_FETCH_OBJ_RW",
|
||||
"ZEND_FETCH_IS",
|
||||
"ZEND_FETCH_DIM_IS",
|
||||
"ZEND_FETCH_OBJ_IS",
|
||||
"ZEND_FETCH_FUNC_ARG",
|
||||
"ZEND_FETCH_DIM_FUNC_ARG",
|
||||
"ZEND_FETCH_OBJ_FUNC_ARG",
|
||||
"ZEND_FETCH_UNSET",
|
||||
"ZEND_FETCH_DIM_UNSET",
|
||||
"ZEND_FETCH_OBJ_UNSET",
|
||||
"ZEND_FETCH_DIM_TMP_VAR",
|
||||
"ZEND_FETCH_CONSTANT",
|
||||
"ZEND_GOTO",
|
||||
"ZEND_EXT_STMT",
|
||||
"ZEND_EXT_FCALL_BEGIN",
|
||||
"ZEND_EXT_FCALL_END",
|
||||
"ZEND_EXT_NOP",
|
||||
"ZEND_TICKS",
|
||||
"ZEND_SEND_VAR_NO_REF",
|
||||
"ZEND_CATCH",
|
||||
"ZEND_THROW",
|
||||
"ZEND_FETCH_CLASS",
|
||||
"ZEND_CLONE",
|
||||
"ZEND_RETURN_BY_REF",
|
||||
"ZEND_INIT_METHOD_CALL",
|
||||
"ZEND_INIT_STATIC_METHOD_CALL",
|
||||
"ZEND_ISSET_ISEMPTY_VAR",
|
||||
"ZEND_ISSET_ISEMPTY_DIM_OBJ",
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"ZEND_PRE_INC_OBJ",
|
||||
"ZEND_PRE_DEC_OBJ",
|
||||
"ZEND_POST_INC_OBJ",
|
||||
"ZEND_POST_DEC_OBJ",
|
||||
"ZEND_ASSIGN_OBJ",
|
||||
NULL,
|
||||
"ZEND_INSTANCEOF",
|
||||
"ZEND_DECLARE_CLASS",
|
||||
"ZEND_DECLARE_INHERITED_CLASS",
|
||||
"ZEND_DECLARE_FUNCTION",
|
||||
"ZEND_RAISE_ABSTRACT_ERROR",
|
||||
"ZEND_DECLARE_CONST",
|
||||
"ZEND_ADD_INTERFACE",
|
||||
"ZEND_DECLARE_INHERITED_CLASS_DELAYED",
|
||||
"ZEND_VERIFY_ABSTRACT_CLASS",
|
||||
"ZEND_ASSIGN_DIM",
|
||||
"ZEND_ISSET_ISEMPTY_PROP_OBJ",
|
||||
"ZEND_HANDLE_EXCEPTION",
|
||||
"ZEND_USER_OPCODE",
|
||||
NULL,
|
||||
"ZEND_JMP_SET",
|
||||
"ZEND_DECLARE_LAMBDA_FUNCTION",
|
||||
"ZEND_ADD_TRAIT",
|
||||
"ZEND_BIND_TRAITS",
|
||||
"ZEND_SEPARATE",
|
||||
"ZEND_QM_ASSIGN_VAR",
|
||||
"ZEND_JMP_SET_VAR",
|
||||
};
|
||||
|
||||
ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {
|
||||
return zend_vm_opcodes_map[opcode];
|
||||
}
|
||||
@@ -18,6 +18,11 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef ZEND_VM_OPCODES_H
|
||||
#define ZEND_VM_OPCODES_H
|
||||
|
||||
ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
|
||||
|
||||
#define ZEND_NOP 0
|
||||
#define ZEND_ADD 1
|
||||
#define ZEND_SUB 2
|
||||
@@ -159,3 +164,5 @@
|
||||
#define ZEND_SEPARATE 156
|
||||
#define ZEND_QM_ASSIGN_VAR 157
|
||||
#define ZEND_JMP_SET_VAR 158
|
||||
|
||||
#endif
|
||||
+46
-5
@@ -2925,14 +2925,17 @@ dnl providerdesc
|
||||
dnl header-file
|
||||
ac_hdrobj=$2
|
||||
|
||||
dnl Add providerdesc.o into global objects when needed
|
||||
dnl Add providerdesc.o or .lo into global objects when needed
|
||||
case $host_alias in
|
||||
*freebsd*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
|
||||
PHP_LDFLAGS="$PHP_LDFLAGS -lelf"
|
||||
;;
|
||||
*solaris*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
|
||||
;;
|
||||
*linux*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -2959,15 +2962,53 @@ dnl DTrace objects
|
||||
esac
|
||||
|
||||
dnl Generate Makefile.objects entries
|
||||
dnl The empty $ac_provsrc command stops an implicit circular dependency
|
||||
dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
|
||||
cat>>Makefile.objects<<EOF
|
||||
|
||||
$abs_srcdir/$ac_provsrc:;
|
||||
|
||||
$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
|
||||
dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@ && \$(SED) -ibak 's,PHP_,DTRACE_,g' \$[]@
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
|
||||
|
||||
\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
|
||||
|
||||
$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
|
||||
dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs
|
||||
EOF
|
||||
|
||||
case $host_alias in
|
||||
*solaris*|*linux*)
|
||||
dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
|
||||
dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
|
||||
dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
|
||||
dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)'
|
||||
for ac_lo in $PHP_DTRACE_OBJS; do
|
||||
dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
|
||||
done;
|
||||
dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692)
|
||||
cat>>Makefile.objects<<EOF
|
||||
$ac_bdir[$]ac_provsrc.lo: \$(PHP_DTRACE_OBJS)
|
||||
echo "[#] Generated by Makefile for libtool" > \$[]@
|
||||
@test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir
|
||||
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\]
|
||||
echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\]
|
||||
else [\\]
|
||||
echo "pic_object='none'" >> \$[]@ [;\\]
|
||||
fi
|
||||
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\]
|
||||
echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\]
|
||||
else [\\]
|
||||
echo "non_pic_object='none'" >> \$[]@ [;\\]
|
||||
fi
|
||||
|
||||
EOF
|
||||
|
||||
;;
|
||||
*)
|
||||
cat>>Makefile.objects<<EOF
|
||||
$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs
|
||||
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
])
|
||||
+3
-3
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=19
|
||||
PHP_RELEASE_VERSION=24
|
||||
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`
|
||||
@@ -1467,7 +1467,7 @@ PHP_ADD_SOURCES(Zend, \
|
||||
zend_ini_parser.c zend_ini_scanner.c \
|
||||
zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c zend_dtrace.c \
|
||||
zend_execute_API.c zend_highlight.c zend_llist.c \
|
||||
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
|
||||
zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
|
||||
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
|
||||
zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \
|
||||
@@ -1582,7 +1582,7 @@ cat <<X
|
||||
| see the file debug.log for error messages. |
|
||||
| |
|
||||
| If you are unable to fix this, send the file debug.log to the |
|
||||
| php-install@lists.php.net mailing list and include appropiate |
|
||||
| php-install@lists.php.net mailing list and include appropriate |
|
||||
| information about your setup. |
|
||||
X
|
||||
fi
|
||||
|
||||
@@ -97,6 +97,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
|
||||
status = BZ2_bzDecompressInit(streamp, 0, data->small_footprint);
|
||||
|
||||
if (BZ_OK != status) {
|
||||
php_stream_bucket_delref(bucket TSRMLS_CC);
|
||||
return PSFS_ERR_FATAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -1068,7 +1068,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
|
||||
{
|
||||
php_curl *ch = (php_curl *) clientp;
|
||||
php_curl_progress *t = ch->handlers->progress;
|
||||
int length = -1;
|
||||
size_t rval = 0;
|
||||
|
||||
#if PHP_CURL_DEBUG
|
||||
@@ -1118,7 +1117,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
|
||||
ch->in_callback = 0;
|
||||
if (error == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
|
||||
length = -1;
|
||||
} else if (retval_ptr) {
|
||||
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
|
||||
convert_to_long_ex(&retval_ptr);
|
||||
@@ -1373,9 +1371,9 @@ static void curl_free_post(void **post)
|
||||
|
||||
/* {{{ curl_free_slist
|
||||
*/
|
||||
static void curl_free_slist(void **slist)
|
||||
static void curl_free_slist(void *slist)
|
||||
{
|
||||
curl_slist_free_all((struct curl_slist *) *slist);
|
||||
curl_slist_free_all(*((struct curl_slist **) slist));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1443,8 +1441,10 @@ static void alloc_curl_handle(php_curl **ch)
|
||||
(*ch)->handlers->read->stream = NULL;
|
||||
|
||||
zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0);
|
||||
zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0);
|
||||
zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0);
|
||||
|
||||
(*ch)->to_free->slist = emalloc(sizeof(HashTable));
|
||||
zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1675,6 +1675,7 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch);
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch);
|
||||
|
||||
efree(dupch->to_free->slist);
|
||||
efree(dupch->to_free);
|
||||
dupch->to_free = ch->to_free;
|
||||
|
||||
@@ -2184,7 +2185,7 @@ string_copy:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
zend_llist_add_element(&ch->to_free->slist, &slist);
|
||||
zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL);
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, slist);
|
||||
|
||||
@@ -2680,8 +2681,9 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
|
||||
/* cURL destructors should be invoked only by last curl handle */
|
||||
if (Z_REFCOUNT_P(ch->clone) <= 1) {
|
||||
zend_llist_clean(&ch->to_free->str);
|
||||
zend_llist_clean(&ch->to_free->slist);
|
||||
zend_llist_clean(&ch->to_free->post);
|
||||
zend_hash_destroy(ch->to_free->slist);
|
||||
efree(ch->to_free->slist);
|
||||
efree(ch->to_free);
|
||||
FREE_ZVAL(ch->clone);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ struct _php_curl_send_headers {
|
||||
struct _php_curl_free {
|
||||
zend_llist str;
|
||||
zend_llist post;
|
||||
zend_llist slist;
|
||||
HashTable *slist;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #65458 (curl memory leak)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) exit("skip curl extension not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
$init = memory_get_usage();
|
||||
for ($i = 0; $i < 10000; $i++) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [ "SOAPAction: getItems" ]);
|
||||
}
|
||||
|
||||
$preclose = memory_get_usage();
|
||||
curl_close($ch);
|
||||
|
||||
// This is a slightly tricky heuristic, but basically, we want to ensure
|
||||
// $preclose - $init has a delta in the order of bytes, not megabytes. Given
|
||||
// the number of iterations in the loop, if we're wasting memory here, we
|
||||
// should have megs and megs of extra allocations.
|
||||
var_dump(($preclose - $init) < 10000);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
+3
-9
@@ -25,10 +25,7 @@ static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1
|
||||
|
||||
static timelib_sll century_value(timelib_sll j)
|
||||
{
|
||||
timelib_sll i = j - 17;
|
||||
timelib_sll c = (4 - i * 2 + (i + 1) / 4) % 7;
|
||||
|
||||
return c < 0 ? c + 7 : c;
|
||||
return 6 - (j % 4) * 2;
|
||||
}
|
||||
|
||||
static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso)
|
||||
@@ -36,11 +33,8 @@ static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_
|
||||
timelib_sll c1, y1, m1, dow;
|
||||
|
||||
/* Only valid for Gregorian calendar, commented out as we don't handle
|
||||
* julian calendar. We just return the 'wrong' day of week to be
|
||||
* consistent.
|
||||
if (y < 1753) {
|
||||
return -1;
|
||||
} */
|
||||
* Julian calendar. We just return the 'wrong' day of week to be
|
||||
* consistent. */
|
||||
c1 = century_value(y / 100);
|
||||
y1 = (y % 100);
|
||||
m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m];
|
||||
|
||||
+98
-5
@@ -25,7 +25,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
{
|
||||
timelib_rel_time *rt;
|
||||
timelib_time *swp;
|
||||
timelib_sll dst_h_corr = 0, dst_m_corr = 0;
|
||||
timelib_sll dst_corr = 0 ,dst_h_corr = 0, dst_m_corr = 0;
|
||||
timelib_time one_backup, two_backup;
|
||||
|
||||
rt = timelib_rel_time_ctor();
|
||||
@@ -43,8 +43,9 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
&& (strcmp(one->tz_info->name, two->tz_info->name) == 0)
|
||||
&& (one->z != two->z))
|
||||
{
|
||||
dst_h_corr = (two->z - one->z) / 3600;
|
||||
dst_m_corr = ((two->z - one->z) % 3600) / 60;
|
||||
dst_corr = two->z - one->z;
|
||||
dst_h_corr = dst_corr / 3600;
|
||||
dst_m_corr = (dst_corr % 3600) / 60;
|
||||
}
|
||||
|
||||
/* Save old TZ info */
|
||||
@@ -57,16 +58,108 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
rt->y = two->y - one->y;
|
||||
rt->m = two->m - one->m;
|
||||
rt->d = two->d - one->d;
|
||||
rt->h = two->h - one->h + dst_h_corr;
|
||||
rt->i = two->i - one->i + dst_m_corr;
|
||||
rt->h = two->h - one->h;
|
||||
rt->i = two->i - one->i;
|
||||
rt->s = two->s - one->s;
|
||||
if (one_backup.dst == 0 && two_backup.dst == 1 && two->sse >= one->sse + 86400 - dst_corr) {
|
||||
rt->h += dst_h_corr;
|
||||
rt->i += dst_m_corr;
|
||||
}
|
||||
|
||||
rt->days = abs(floor((one->sse - two->sse - (dst_h_corr * 3600) - (dst_m_corr * 60)) / 86400));
|
||||
|
||||
timelib_do_rel_normalize(rt->invert ? one : two, rt);
|
||||
|
||||
/* We need to do this after normalisation otherwise we can't get "24H" */
|
||||
if (one_backup.dst == 1 && two_backup.dst == 0 && two->sse >= one->sse + 86400) {
|
||||
if (two->sse < one->sse + 86400 - dst_corr) {
|
||||
rt->d--;
|
||||
rt->h = 24;
|
||||
} else {
|
||||
rt->h += dst_h_corr;
|
||||
rt->i += dst_m_corr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore old TZ info */
|
||||
memcpy(one, &one_backup, sizeof(one_backup));
|
||||
memcpy(two, &two_backup, sizeof(two_backup));
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
||||
timelib_time *timelib_add(timelib_time *old_time, timelib_rel_time *interval)
|
||||
{
|
||||
int bias = 1;
|
||||
timelib_time *t = timelib_time_clone(old_time);
|
||||
|
||||
if (interval->have_weekday_relative || interval->have_special_relative) {
|
||||
memcpy(&t->relative, interval, sizeof(struct timelib_rel_time));
|
||||
} else {
|
||||
if (interval->invert) {
|
||||
bias = -1;
|
||||
}
|
||||
memset(&t->relative, 0, sizeof(struct timelib_rel_time));
|
||||
t->relative.y = interval->y * bias;
|
||||
t->relative.m = interval->m * bias;
|
||||
t->relative.d = interval->d * bias;
|
||||
t->relative.h = interval->h * bias;
|
||||
t->relative.i = interval->i * bias;
|
||||
t->relative.s = interval->s * bias;
|
||||
}
|
||||
t->have_relative = 1;
|
||||
t->sse_uptodate = 0;
|
||||
|
||||
timelib_update_ts(t, NULL);
|
||||
|
||||
// printf("%lld %lld %d\n", old_time->dst, t->dst, (t->sse - old_time->sse));
|
||||
/* Adjust for backwards DST changeover */
|
||||
if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) {
|
||||
t->sse -= old_time->z;
|
||||
t->sse += t->z;
|
||||
}
|
||||
|
||||
timelib_update_from_sse(t);
|
||||
t->have_relative = 0;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
timelib_time *timelib_sub(timelib_time *old_time, timelib_rel_time *interval)
|
||||
{
|
||||
int bias = 1;
|
||||
timelib_time *t = timelib_time_clone(old_time);
|
||||
|
||||
if (interval->invert) {
|
||||
bias = -1;
|
||||
}
|
||||
|
||||
memset(&t->relative, 0, sizeof(struct timelib_rel_time));
|
||||
t->relative.y = 0 - (interval->y * bias);
|
||||
t->relative.m = 0 - (interval->m * bias);
|
||||
t->relative.d = 0 - (interval->d * bias);
|
||||
t->relative.h = 0 - (interval->h * bias);
|
||||
t->relative.i = 0 - (interval->i * bias);
|
||||
t->relative.s = 0 - (interval->s * bias);
|
||||
t->have_relative = 1;
|
||||
t->sse_uptodate = 0;
|
||||
|
||||
timelib_update_ts(t, NULL);
|
||||
|
||||
/* Adjust for backwards DST changeover */
|
||||
if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) {
|
||||
t->sse -= old_time->z;
|
||||
t->sse += t->z;
|
||||
}
|
||||
/* Adjust for forwards DST changeover */
|
||||
if (old_time->dst == 0 && t->dst == 1 && !interval->y && !interval->m && !interval->d ) {
|
||||
t->sse -= old_time->z;
|
||||
t->sse += t->z;
|
||||
}
|
||||
|
||||
timelib_update_from_sse(t);
|
||||
|
||||
t->have_relative = 0;
|
||||
|
||||
return t;
|
||||
}
|
||||
+102
-101
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */
|
||||
/* Generated by re2c 0.13.5 on Sun Aug 25 14:46:08 2013 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -651,7 +651,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
char *begin = *ptr, *end;
|
||||
const timelib_relunit *tp, *value = NULL;
|
||||
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') {
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' &&
|
||||
**ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
@@ -871,11 +872,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 997 "ext/date/lib/parse_date.re"
|
||||
#line 998 "ext/date/lib/parse_date.re"
|
||||
|
||||
|
||||
|
||||
#line 879 "ext/date/lib/parse_date.c"
|
||||
#line 880 "ext/date/lib/parse_date.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -995,7 +996,7 @@ std:
|
||||
}
|
||||
yy2:
|
||||
YYDEBUG(2, *YYCURSOR);
|
||||
#line 1083 "ext/date/lib/parse_date.re"
|
||||
#line 1084 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
@@ -1011,7 +1012,7 @@ yy2:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 1015 "ext/date/lib/parse_date.c"
|
||||
#line 1016 "ext/date/lib/parse_date.c"
|
||||
yy3:
|
||||
YYDEBUG(3, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1034,7 +1035,7 @@ yy3:
|
||||
}
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
#line 1677 "ext/date/lib/parse_date.re"
|
||||
#line 1678 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
@@ -1047,7 +1048,7 @@ yy4:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIMEZONE;
|
||||
}
|
||||
#line 1051 "ext/date/lib/parse_date.c"
|
||||
#line 1052 "ext/date/lib/parse_date.c"
|
||||
yy5:
|
||||
YYDEBUG(5, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1358,12 +1359,12 @@ yy12:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
#line 1772 "ext/date/lib/parse_date.re"
|
||||
#line 1773 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 1367 "ext/date/lib/parse_date.c"
|
||||
#line 1368 "ext/date/lib/parse_date.c"
|
||||
yy14:
|
||||
YYDEBUG(14, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2420,11 +2421,11 @@ yy49:
|
||||
if (yych <= '9') goto yy55;
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
#line 1761 "ext/date/lib/parse_date.re"
|
||||
#line 1762 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 2428 "ext/date/lib/parse_date.c"
|
||||
#line 2429 "ext/date/lib/parse_date.c"
|
||||
yy51:
|
||||
YYDEBUG(51, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2433,12 +2434,12 @@ yy52:
|
||||
YYDEBUG(52, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
#line 1766 "ext/date/lib/parse_date.re"
|
||||
#line 1767 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 2442 "ext/date/lib/parse_date.c"
|
||||
#line 2443 "ext/date/lib/parse_date.c"
|
||||
yy54:
|
||||
YYDEBUG(54, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2825,7 +2826,7 @@ yy72:
|
||||
if (yych == 's') goto yy74;
|
||||
yy73:
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
#line 1745 "ext/date/lib/parse_date.re"
|
||||
#line 1746 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
@@ -2840,7 +2841,7 @@ yy73:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 2844 "ext/date/lib/parse_date.c"
|
||||
#line 2845 "ext/date/lib/parse_date.c"
|
||||
yy74:
|
||||
YYDEBUG(74, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -3602,7 +3603,7 @@ yy166:
|
||||
}
|
||||
yy167:
|
||||
YYDEBUG(167, *YYCURSOR);
|
||||
#line 1608 "ext/date/lib/parse_date.re"
|
||||
#line 1609 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
@@ -3619,7 +3620,7 @@ yy167:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
#line 3623 "ext/date/lib/parse_date.c"
|
||||
#line 3624 "ext/date/lib/parse_date.c"
|
||||
yy168:
|
||||
YYDEBUG(168, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4139,7 +4140,7 @@ yy193:
|
||||
}
|
||||
yy194:
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
#line 1667 "ext/date/lib/parse_date.re"
|
||||
#line 1668 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
@@ -4148,7 +4149,7 @@ yy194:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4152 "ext/date/lib/parse_date.c"
|
||||
#line 4153 "ext/date/lib/parse_date.c"
|
||||
yy195:
|
||||
YYDEBUG(195, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -4199,7 +4200,7 @@ yy198:
|
||||
}
|
||||
yy199:
|
||||
YYDEBUG(199, *YYCURSOR);
|
||||
#line 1413 "ext/date/lib/parse_date.re"
|
||||
#line 1414 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
@@ -4212,7 +4213,7 @@ yy199:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4216 "ext/date/lib/parse_date.c"
|
||||
#line 4217 "ext/date/lib/parse_date.c"
|
||||
yy200:
|
||||
YYDEBUG(200, *YYCURSOR);
|
||||
yyaccept = 6;
|
||||
@@ -4481,7 +4482,7 @@ yy222:
|
||||
}
|
||||
yy223:
|
||||
YYDEBUG(223, *YYCURSOR);
|
||||
#line 1715 "ext/date/lib/parse_date.re"
|
||||
#line 1716 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
@@ -4510,7 +4511,7 @@ yy223:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4514 "ext/date/lib/parse_date.c"
|
||||
#line 4515 "ext/date/lib/parse_date.c"
|
||||
yy224:
|
||||
YYDEBUG(224, *YYCURSOR);
|
||||
yyaccept = 7;
|
||||
@@ -5208,7 +5209,7 @@ yy278:
|
||||
YYDEBUG(278, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(279, *YYCURSOR);
|
||||
#line 1691 "ext/date/lib/parse_date.re"
|
||||
#line 1692 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -5231,7 +5232,7 @@ yy278:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 5235 "ext/date/lib/parse_date.c"
|
||||
#line 5236 "ext/date/lib/parse_date.c"
|
||||
yy280:
|
||||
YYDEBUG(280, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5409,7 +5410,7 @@ yy294:
|
||||
++YYCURSOR;
|
||||
yy295:
|
||||
YYDEBUG(295, *YYCURSOR);
|
||||
#line 1385 "ext/date/lib/parse_date.re"
|
||||
#line 1386 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
@@ -5422,7 +5423,7 @@ yy295:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 5426 "ext/date/lib/parse_date.c"
|
||||
#line 5427 "ext/date/lib/parse_date.c"
|
||||
yy296:
|
||||
YYDEBUG(296, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6642,7 +6643,7 @@ yy362:
|
||||
if (yych <= '9') goto yy365;
|
||||
yy364:
|
||||
YYDEBUG(364, *YYCURSOR);
|
||||
#line 1529 "ext/date/lib/parse_date.re"
|
||||
#line 1530 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
@@ -6655,7 +6656,7 @@ yy364:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 6659 "ext/date/lib/parse_date.c"
|
||||
#line 6660 "ext/date/lib/parse_date.c"
|
||||
yy365:
|
||||
YYDEBUG(365, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7293,7 +7294,7 @@ yy392:
|
||||
}
|
||||
yy393:
|
||||
YYDEBUG(393, *YYCURSOR);
|
||||
#line 1587 "ext/date/lib/parse_date.re"
|
||||
#line 1588 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
@@ -7313,7 +7314,7 @@ yy393:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AGO;
|
||||
}
|
||||
#line 7317 "ext/date/lib/parse_date.c"
|
||||
#line 7318 "ext/date/lib/parse_date.c"
|
||||
yy394:
|
||||
YYDEBUG(394, *YYCURSOR);
|
||||
yyaccept = 5;
|
||||
@@ -9063,7 +9064,7 @@ yy454:
|
||||
++YYCURSOR;
|
||||
yy455:
|
||||
YYDEBUG(455, *YYCURSOR);
|
||||
#line 1290 "ext/date/lib/parse_date.re"
|
||||
#line 1291 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
@@ -9074,7 +9075,7 @@ yy455:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 9078 "ext/date/lib/parse_date.c"
|
||||
#line 9079 "ext/date/lib/parse_date.c"
|
||||
yy456:
|
||||
YYDEBUG(456, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -9634,7 +9635,7 @@ yy475:
|
||||
}
|
||||
yy476:
|
||||
YYDEBUG(476, *YYCURSOR);
|
||||
#line 1427 "ext/date/lib/parse_date.re"
|
||||
#line 1428 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -9645,7 +9646,7 @@ yy476:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 9649 "ext/date/lib/parse_date.c"
|
||||
#line 9650 "ext/date/lib/parse_date.c"
|
||||
yy477:
|
||||
YYDEBUG(477, *YYCURSOR);
|
||||
yyaccept = 10;
|
||||
@@ -9786,7 +9787,7 @@ yy488:
|
||||
YYDEBUG(488, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(489, *YYCURSOR);
|
||||
#line 1145 "ext/date/lib/parse_date.re"
|
||||
#line 1146 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -9802,7 +9803,7 @@ yy488:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME12;
|
||||
}
|
||||
#line 9806 "ext/date/lib/parse_date.c"
|
||||
#line 9807 "ext/date/lib/parse_date.c"
|
||||
yy490:
|
||||
YYDEBUG(490, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -9815,7 +9816,7 @@ yy490:
|
||||
}
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
#line 1182 "ext/date/lib/parse_date.re"
|
||||
#line 1183 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
@@ -9840,7 +9841,7 @@ yy491:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9844 "ext/date/lib/parse_date.c"
|
||||
#line 9845 "ext/date/lib/parse_date.c"
|
||||
yy492:
|
||||
YYDEBUG(492, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10150,7 +10151,7 @@ yy523:
|
||||
YYDEBUG(523, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(524, *YYCURSOR);
|
||||
#line 1162 "ext/date/lib/parse_date.re"
|
||||
#line 1163 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
@@ -10169,7 +10170,7 @@ yy523:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 10173 "ext/date/lib/parse_date.c"
|
||||
#line 10174 "ext/date/lib/parse_date.c"
|
||||
yy525:
|
||||
YYDEBUG(525, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10275,7 +10276,7 @@ yy534:
|
||||
if (yych <= '9') goto yy541;
|
||||
yy535:
|
||||
YYDEBUG(535, *YYCURSOR);
|
||||
#line 1344 "ext/date/lib/parse_date.re"
|
||||
#line 1345 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datefull");
|
||||
@@ -10289,7 +10290,7 @@ yy535:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
#line 10293 "ext/date/lib/parse_date.c"
|
||||
#line 10294 "ext/date/lib/parse_date.c"
|
||||
yy536:
|
||||
YYDEBUG(536, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -11026,7 +11027,7 @@ yy605:
|
||||
YYDEBUG(606, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(607, *YYCURSOR);
|
||||
#line 1359 "ext/date/lib/parse_date.re"
|
||||
#line 1360 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
@@ -11037,7 +11038,7 @@ yy605:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11041 "ext/date/lib/parse_date.c"
|
||||
#line 11042 "ext/date/lib/parse_date.c"
|
||||
yy608:
|
||||
YYDEBUG(608, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11073,7 +11074,7 @@ yy611:
|
||||
if (yych <= '9') goto yy605;
|
||||
yy612:
|
||||
YYDEBUG(612, *YYCURSOR);
|
||||
#line 1371 "ext/date/lib/parse_date.re"
|
||||
#line 1372 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
@@ -11086,7 +11087,7 @@ yy612:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11090 "ext/date/lib/parse_date.c"
|
||||
#line 11091 "ext/date/lib/parse_date.c"
|
||||
yy613:
|
||||
YYDEBUG(613, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11727,7 +11728,7 @@ yy656:
|
||||
}
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
#line 1330 "ext/date/lib/parse_date.re"
|
||||
#line 1331 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
@@ -11740,7 +11741,7 @@ yy657:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11744 "ext/date/lib/parse_date.c"
|
||||
#line 11745 "ext/date/lib/parse_date.c"
|
||||
yy658:
|
||||
YYDEBUG(658, *YYCURSOR);
|
||||
yyaccept = 13;
|
||||
@@ -11846,7 +11847,7 @@ yy666:
|
||||
}
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
#line 1274 "ext/date/lib/parse_date.re"
|
||||
#line 1275 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
@@ -11861,7 +11862,7 @@ yy667:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
}
|
||||
#line 11865 "ext/date/lib/parse_date.c"
|
||||
#line 11866 "ext/date/lib/parse_date.c"
|
||||
yy668:
|
||||
YYDEBUG(668, *YYCURSOR);
|
||||
yyaccept = 14;
|
||||
@@ -12094,7 +12095,7 @@ yy700:
|
||||
if (yych <= ':') goto yy704;
|
||||
yy701:
|
||||
YYDEBUG(701, *YYCURSOR);
|
||||
#line 1557 "ext/date/lib/parse_date.re"
|
||||
#line 1558 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
@@ -12114,7 +12115,7 @@ yy701:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12118 "ext/date/lib/parse_date.c"
|
||||
#line 12119 "ext/date/lib/parse_date.c"
|
||||
yy702:
|
||||
YYDEBUG(702, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12666,7 +12667,7 @@ yy763:
|
||||
}
|
||||
yy764:
|
||||
YYDEBUG(764, *YYCURSOR);
|
||||
#line 1302 "ext/date/lib/parse_date.re"
|
||||
#line 1303 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
@@ -12679,7 +12680,7 @@ yy764:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 12683 "ext/date/lib/parse_date.c"
|
||||
#line 12684 "ext/date/lib/parse_date.c"
|
||||
yy765:
|
||||
YYDEBUG(765, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12718,7 +12719,7 @@ yy771:
|
||||
YYDEBUG(771, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
#line 1543 "ext/date/lib/parse_date.re"
|
||||
#line 1544 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
@@ -12731,7 +12732,7 @@ yy771:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 12735 "ext/date/lib/parse_date.c"
|
||||
#line 12736 "ext/date/lib/parse_date.c"
|
||||
yy773:
|
||||
YYDEBUG(773, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12869,7 +12870,7 @@ yy783:
|
||||
}
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
#line 1578 "ext/date/lib/parse_date.re"
|
||||
#line 1579 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
@@ -12877,7 +12878,7 @@ yy784:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12881 "ext/date/lib/parse_date.c"
|
||||
#line 12882 "ext/date/lib/parse_date.c"
|
||||
yy785:
|
||||
YYDEBUG(785, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13028,7 +13029,7 @@ yy793:
|
||||
}
|
||||
yy794:
|
||||
YYDEBUG(794, *YYCURSOR);
|
||||
#line 1399 "ext/date/lib/parse_date.re"
|
||||
#line 1400 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
@@ -13041,7 +13042,7 @@ yy794:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 13045 "ext/date/lib/parse_date.c"
|
||||
#line 13046 "ext/date/lib/parse_date.c"
|
||||
yy795:
|
||||
YYDEBUG(795, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13256,7 +13257,7 @@ yy814:
|
||||
if (yych <= '7') goto yy817;
|
||||
yy815:
|
||||
YYDEBUG(815, *YYCURSOR);
|
||||
#line 1510 "ext/date/lib/parse_date.re"
|
||||
#line 1511 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
@@ -13274,7 +13275,7 @@ yy815:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13278 "ext/date/lib/parse_date.c"
|
||||
#line 13279 "ext/date/lib/parse_date.c"
|
||||
yy816:
|
||||
YYDEBUG(816, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13284,7 +13285,7 @@ yy817:
|
||||
YYDEBUG(817, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(818, *YYCURSOR);
|
||||
#line 1491 "ext/date/lib/parse_date.re"
|
||||
#line 1492 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
@@ -13302,7 +13303,7 @@ yy817:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13306 "ext/date/lib/parse_date.c"
|
||||
#line 13307 "ext/date/lib/parse_date.c"
|
||||
yy819:
|
||||
YYDEBUG(819, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13366,7 +13367,7 @@ yy821:
|
||||
}
|
||||
yy822:
|
||||
YYDEBUG(822, *YYCURSOR);
|
||||
#line 1477 "ext/date/lib/parse_date.re"
|
||||
#line 1478 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
@@ -13379,7 +13380,7 @@ yy822:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
#line 13383 "ext/date/lib/parse_date.c"
|
||||
#line 13384 "ext/date/lib/parse_date.c"
|
||||
yy823:
|
||||
YYDEBUG(823, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13482,7 +13483,7 @@ yy842:
|
||||
++YYCURSOR;
|
||||
yy843:
|
||||
YYDEBUG(843, *YYCURSOR);
|
||||
#line 1451 "ext/date/lib/parse_date.re"
|
||||
#line 1452 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
@@ -13507,7 +13508,7 @@ yy843:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_XMLRPC_SOAP;
|
||||
}
|
||||
#line 13511 "ext/date/lib/parse_date.c"
|
||||
#line 13512 "ext/date/lib/parse_date.c"
|
||||
yy844:
|
||||
YYDEBUG(844, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13769,7 +13770,7 @@ yy848:
|
||||
}
|
||||
yy849:
|
||||
YYDEBUG(849, *YYCURSOR);
|
||||
#line 1439 "ext/date/lib/parse_date.re"
|
||||
#line 1440 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -13780,7 +13781,7 @@ yy849:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NOCOLON;
|
||||
}
|
||||
#line 13784 "ext/date/lib/parse_date.c"
|
||||
#line 13785 "ext/date/lib/parse_date.c"
|
||||
yy850:
|
||||
YYDEBUG(850, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -14700,7 +14701,7 @@ yy973:
|
||||
if (yych <= '9') goto yy996;
|
||||
yy974:
|
||||
YYDEBUG(974, *YYCURSOR);
|
||||
#line 1316 "ext/date/lib/parse_date.re"
|
||||
#line 1317 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
@@ -14713,7 +14714,7 @@ yy974:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 14717 "ext/date/lib/parse_date.c"
|
||||
#line 14718 "ext/date/lib/parse_date.c"
|
||||
yy975:
|
||||
YYDEBUG(975, *YYCURSOR);
|
||||
yyaccept = 22;
|
||||
@@ -15722,7 +15723,7 @@ yy1066:
|
||||
}
|
||||
yy1068:
|
||||
YYDEBUG(1068, *YYCURSOR);
|
||||
#line 1208 "ext/date/lib/parse_date.re"
|
||||
#line 1209 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -15744,7 +15745,7 @@ yy1068:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_GNU_NOCOLON;
|
||||
}
|
||||
#line 15748 "ext/date/lib/parse_date.c"
|
||||
#line 15749 "ext/date/lib/parse_date.c"
|
||||
yy1069:
|
||||
YYDEBUG(1069, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -15836,7 +15837,7 @@ yy1075:
|
||||
}
|
||||
yy1076:
|
||||
YYDEBUG(1076, *YYCURSOR);
|
||||
#line 1254 "ext/date/lib/parse_date.re"
|
||||
#line 1255 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
@@ -15855,7 +15856,7 @@ yy1076:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_NOCOLON;
|
||||
}
|
||||
#line 15859 "ext/date/lib/parse_date.c"
|
||||
#line 15860 "ext/date/lib/parse_date.c"
|
||||
yy1077:
|
||||
YYDEBUG(1077, *YYCURSOR);
|
||||
yyaccept = 25;
|
||||
@@ -16753,7 +16754,7 @@ yy1117:
|
||||
}
|
||||
yy1118:
|
||||
YYDEBUG(1118, *YYCURSOR);
|
||||
#line 1650 "ext/date/lib/parse_date.re"
|
||||
#line 1651 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16769,7 +16770,7 @@ yy1118:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16773 "ext/date/lib/parse_date.c"
|
||||
#line 16774 "ext/date/lib/parse_date.c"
|
||||
yy1119:
|
||||
YYDEBUG(1119, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -16820,7 +16821,7 @@ yy1126:
|
||||
YYDEBUG(1126, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1127, *YYCURSOR);
|
||||
#line 1123 "ext/date/lib/parse_date.re"
|
||||
#line 1124 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16841,7 +16842,7 @@ yy1126:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEK_DAY_OF_MONTH;
|
||||
}
|
||||
#line 16845 "ext/date/lib/parse_date.c"
|
||||
#line 16846 "ext/date/lib/parse_date.c"
|
||||
yy1128:
|
||||
YYDEBUG(1128, *YYCURSOR);
|
||||
yyaccept = 26;
|
||||
@@ -16949,7 +16950,7 @@ yy1141:
|
||||
}
|
||||
yy1142:
|
||||
YYDEBUG(1142, *YYCURSOR);
|
||||
#line 1626 "ext/date/lib/parse_date.re"
|
||||
#line 1627 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16972,7 +16973,7 @@ yy1142:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16976 "ext/date/lib/parse_date.c"
|
||||
#line 16977 "ext/date/lib/parse_date.c"
|
||||
yy1143:
|
||||
YYDEBUG(1143, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -19649,7 +19650,7 @@ yy1294:
|
||||
goto yy1298;
|
||||
yy1295:
|
||||
YYDEBUG(1295, *YYCURSOR);
|
||||
#line 1100 "ext/date/lib/parse_date.re"
|
||||
#line 1101 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
@@ -19671,7 +19672,7 @@ yy1295:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19675 "ext/date/lib/parse_date.c"
|
||||
#line 19676 "ext/date/lib/parse_date.c"
|
||||
yy1296:
|
||||
YYDEBUG(1296, *YYCURSOR);
|
||||
yyaccept = 28;
|
||||
@@ -21362,7 +21363,7 @@ yy1385:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy1387:
|
||||
YYDEBUG(1387, *YYCURSOR);
|
||||
#line 1057 "ext/date/lib/parse_date.re"
|
||||
#line 1058 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
|
||||
@@ -21387,7 +21388,7 @@ yy1387:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21391 "ext/date/lib/parse_date.c"
|
||||
#line 21392 "ext/date/lib/parse_date.c"
|
||||
yy1388:
|
||||
YYDEBUG(1388, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21823,7 +21824,7 @@ yy1416:
|
||||
++YYCURSOR;
|
||||
yy1417:
|
||||
YYDEBUG(1417, *YYCURSOR);
|
||||
#line 1045 "ext/date/lib/parse_date.re"
|
||||
#line 1046 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("tomorrow");
|
||||
TIMELIB_INIT;
|
||||
@@ -21834,7 +21835,7 @@ yy1417:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21838 "ext/date/lib/parse_date.c"
|
||||
#line 21839 "ext/date/lib/parse_date.c"
|
||||
yy1418:
|
||||
YYDEBUG(1418, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21869,7 +21870,7 @@ yy1419:
|
||||
}
|
||||
yy1420:
|
||||
YYDEBUG(1420, *YYCURSOR);
|
||||
#line 1035 "ext/date/lib/parse_date.re"
|
||||
#line 1036 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("midnight | today");
|
||||
TIMELIB_INIT;
|
||||
@@ -21878,7 +21879,7 @@ yy1420:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21882 "ext/date/lib/parse_date.c"
|
||||
#line 21883 "ext/date/lib/parse_date.c"
|
||||
yy1421:
|
||||
YYDEBUG(1421, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23890,7 +23891,7 @@ yy1499:
|
||||
}
|
||||
yy1500:
|
||||
YYDEBUG(1500, *YYCURSOR);
|
||||
#line 1014 "ext/date/lib/parse_date.re"
|
||||
#line 1015 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("now");
|
||||
TIMELIB_INIT;
|
||||
@@ -23898,7 +23899,7 @@ yy1500:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23902 "ext/date/lib/parse_date.c"
|
||||
#line 23903 "ext/date/lib/parse_date.c"
|
||||
yy1501:
|
||||
YYDEBUG(1501, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -24037,7 +24038,7 @@ yy1507:
|
||||
}
|
||||
yy1508:
|
||||
YYDEBUG(1508, *YYCURSOR);
|
||||
#line 1023 "ext/date/lib/parse_date.re"
|
||||
#line 1024 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("noon");
|
||||
TIMELIB_INIT;
|
||||
@@ -24048,7 +24049,7 @@ yy1508:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24052 "ext/date/lib/parse_date.c"
|
||||
#line 24053 "ext/date/lib/parse_date.c"
|
||||
yy1509:
|
||||
YYDEBUG(1509, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24581,7 +24582,7 @@ yy1530:
|
||||
++YYCURSOR;
|
||||
yy1531:
|
||||
YYDEBUG(1531, *YYCURSOR);
|
||||
#line 1002 "ext/date/lib/parse_date.re"
|
||||
#line 1003 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("yesterday");
|
||||
TIMELIB_INIT;
|
||||
@@ -24592,7 +24593,7 @@ yy1531:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24596 "ext/date/lib/parse_date.c"
|
||||
#line 24597 "ext/date/lib/parse_date.c"
|
||||
yy1532:
|
||||
YYDEBUG(1532, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24765,7 +24766,7 @@ yy1537:
|
||||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1776 "ext/date/lib/parse_date.re"
|
||||
#line 1777 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
@@ -25035,7 +25036,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
|
||||
if (sec == TIMELIB_UNSET || length != 2) {
|
||||
add_pbf_error(s, "A two second minute could not be found", string, begin);
|
||||
add_pbf_error(s, "A two digit second could not be found", string, begin);
|
||||
} else {
|
||||
s->time->s = sec;
|
||||
}
|
||||
@@ -25123,7 +25124,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
break;
|
||||
|
||||
case '\\': /* escaped char */
|
||||
*fptr++;
|
||||
fptr++;
|
||||
if (*ptr == *fptr) {
|
||||
++ptr;
|
||||
} else {
|
||||
|
||||
@@ -649,7 +649,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
char *begin = *ptr, *end;
|
||||
const timelib_relunit *tp, *value = NULL;
|
||||
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') {
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' &&
|
||||
**ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
@@ -2042,7 +2043,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
|
||||
if (sec == TIMELIB_UNSET || length != 2) {
|
||||
add_pbf_error(s, "A two second minute could not be found", string, begin);
|
||||
add_pbf_error(s, "A two digit second could not be found", string, begin);
|
||||
} else {
|
||||
s->time->s = sec;
|
||||
}
|
||||
@@ -2130,7 +2131,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
break;
|
||||
|
||||
case '\\': /* escaped char */
|
||||
*fptr++;
|
||||
fptr++;
|
||||
if (*ptr == *fptr) {
|
||||
++ptr;
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:27 2011 */
|
||||
/* Generated by re2c 0.13.5 on Wed Nov 27 11:10:58 2013 */
|
||||
#line 1 "ext/date/lib/parse_iso_intervals.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -415,7 +415,7 @@ yy6:
|
||||
break;
|
||||
}
|
||||
ptr++;
|
||||
} while (*ptr);
|
||||
} while (!s->errors->error_count && *ptr);
|
||||
s->have_period = 1;
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PERIOD;
|
||||
|
||||
@@ -383,7 +383,7 @@ isoweek = year4 "-"? "W" weekofyear;
|
||||
break;
|
||||
}
|
||||
ptr++;
|
||||
} while (*ptr);
|
||||
} while (!s->errors->error_count && *ptr);
|
||||
s->have_period = 1;
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PERIOD;
|
||||
|
||||
@@ -136,5 +136,7 @@ int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double lat,
|
||||
|
||||
/* from interval.c */
|
||||
timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two);
|
||||
timelib_time *timelib_add(timelib_time *t, timelib_rel_time *interval);
|
||||
timelib_time *timelib_sub(timelib_time *t, timelib_rel_time *interval);
|
||||
|
||||
#endif
|
||||
+922
-930
File diff suppressed because it is too large.
Load diff
@@ -137,19 +137,16 @@ void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts)
|
||||
void timelib_update_from_sse(timelib_time *tm)
|
||||
{
|
||||
timelib_sll sse;
|
||||
int z = tm->z;
|
||||
signed int dst = tm->dst;
|
||||
|
||||
sse = tm->sse;
|
||||
|
||||
switch (tm->zone_type) {
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
int z = tm->z;
|
||||
signed int dst = tm->dst;
|
||||
|
||||
timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60) + (tm->dst * 3600));
|
||||
|
||||
tm->z = z;
|
||||
tm->dst = dst;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -171,6 +168,8 @@ cleanup:
|
||||
tm->sse = sse;
|
||||
tm->is_localtime = 1;
|
||||
tm->have_zone = 1;
|
||||
tm->z = z;
|
||||
tm->dst = dst;
|
||||
}
|
||||
|
||||
void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
|
||||
|
||||
+34
-53
@@ -752,6 +752,14 @@ PHP_RSHUTDOWN_FUNCTION(date)
|
||||
|
||||
#define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO"
|
||||
|
||||
/*
|
||||
* This comes from various sources that like to contradict. I'm going with the
|
||||
* format here because of:
|
||||
* http://msdn.microsoft.com/en-us/library/windows/desktop/aa384321%28v=vs.85%29.aspx
|
||||
* and http://curl.haxx.se/rfc/cookie_spec.html
|
||||
*/
|
||||
#define DATE_FORMAT_COOKIE "l, d-M-Y H:i:s T"
|
||||
|
||||
#define DATE_TZ_ERRMSG \
|
||||
"It is not safe to rely on the system's timezone settings. You are " \
|
||||
"*required* to use the date.timezone setting or the " \
|
||||
@@ -783,7 +791,7 @@ PHP_MINIT_FUNCTION(date)
|
||||
* with the variations that the only legal time zone is GMT
|
||||
* and the separators between the elements of the date must be dashes."
|
||||
*/
|
||||
REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_COOKIE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC822, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
|
||||
@@ -997,7 +1005,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
|
||||
static char *date_format(char *format, int format_len, timelib_time *t, int localtime)
|
||||
{
|
||||
smart_str string = {0};
|
||||
int i, length;
|
||||
int i, length = 0;
|
||||
char buffer[97];
|
||||
timelib_time_offset *offset = NULL;
|
||||
timelib_sll isoweek, isoyear;
|
||||
@@ -1352,7 +1360,7 @@ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_parse_date: Backwards compability function */
|
||||
/* {{{ php_parse_date: Backwards compatibility function */
|
||||
PHPAPI signed long php_parse_date(char *string, signed long *now)
|
||||
{
|
||||
timelib_time *parsed_time;
|
||||
@@ -1362,6 +1370,7 @@ PHPAPI signed long php_parse_date(char *string, signed long *now)
|
||||
|
||||
parsed_time = timelib_strtotime(string, strlen(string), &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
if (error->error_count) {
|
||||
timelib_time_dtor(parsed_time);
|
||||
timelib_error_container_dtor(error);
|
||||
return -1;
|
||||
}
|
||||
@@ -1947,7 +1956,7 @@ static void date_register_classes(TSRMLS_D)
|
||||
zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
|
||||
|
||||
REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC850);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_COOKIE);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("ISO8601", DATE_FORMAT_ISO8601);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC822);
|
||||
REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850);
|
||||
@@ -2113,13 +2122,13 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
|
||||
/* first we add the date and time in ISO format */
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_STRING(zv, date_format("Y-m-d H:i:s", 12, dateobj->time, 1), 0);
|
||||
zend_hash_update(props, "date", 5, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "date", 5, &zv, sizeof(zv), NULL);
|
||||
|
||||
/* then we add the timezone name (or similar) */
|
||||
if (dateobj->time->is_localtime) {
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_LONG(zv, dateobj->time->zone_type);
|
||||
zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
switch (dateobj->time->zone_type) {
|
||||
@@ -2142,7 +2151,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
|
||||
ZVAL_STRING(zv, dateobj->time->tz_abbr, 1);
|
||||
break;
|
||||
}
|
||||
zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL);
|
||||
}
|
||||
|
||||
return props;
|
||||
@@ -2265,7 +2274,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
|
||||
MAKE_STD_ZVAL(zv); \
|
||||
ZVAL_LONG(zv, (long)intervalobj->diff->f); \
|
||||
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zv), NULL);
|
||||
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("m", m);
|
||||
@@ -2282,7 +2291,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
} else {
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_FALSE(zv);
|
||||
zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "days", 5, &zv, sizeof(zv), NULL);
|
||||
}
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount);
|
||||
@@ -2409,8 +2418,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
|
||||
timelib_time *now;
|
||||
timelib_tzinfo *tzi = NULL;
|
||||
timelib_error_container *err = NULL;
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst;
|
||||
char *new_abbr;
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
|
||||
char *new_abbr = NULL;
|
||||
timelib_sll new_offset;
|
||||
|
||||
if (dateobj->time) {
|
||||
@@ -2478,6 +2487,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
|
||||
|
||||
timelib_fill_holes(dateobj->time, now, TIMELIB_NO_CLONE);
|
||||
timelib_update_ts(dateobj->time, tzi);
|
||||
timelib_update_from_sse(dateobj->time);
|
||||
|
||||
dateobj->time->have_relative = 0;
|
||||
|
||||
@@ -2879,7 +2889,7 @@ PHP_FUNCTION(date_add)
|
||||
zval *object, *interval;
|
||||
php_date_obj *dateobj;
|
||||
php_interval_obj *intobj;
|
||||
int bias = 1;
|
||||
timelib_time *new_time;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
@@ -2889,27 +2899,9 @@ PHP_FUNCTION(date_add)
|
||||
intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC);
|
||||
DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval);
|
||||
|
||||
|
||||
if (intobj->diff->have_weekday_relative || intobj->diff->have_special_relative) {
|
||||
memcpy(&dateobj->time->relative, intobj->diff, sizeof(struct timelib_rel_time));
|
||||
} else {
|
||||
if (intobj->diff->invert) {
|
||||
bias = -1;
|
||||
}
|
||||
memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
|
||||
dateobj->time->relative.y = intobj->diff->y * bias;
|
||||
dateobj->time->relative.m = intobj->diff->m * bias;
|
||||
dateobj->time->relative.d = intobj->diff->d * bias;
|
||||
dateobj->time->relative.h = intobj->diff->h * bias;
|
||||
dateobj->time->relative.i = intobj->diff->i * bias;
|
||||
dateobj->time->relative.s = intobj->diff->s * bias;
|
||||
}
|
||||
dateobj->time->have_relative = 1;
|
||||
dateobj->time->sse_uptodate = 0;
|
||||
|
||||
timelib_update_ts(dateobj->time, NULL);
|
||||
timelib_update_from_sse(dateobj->time);
|
||||
dateobj->time->have_relative = 0;
|
||||
new_time = timelib_add(dateobj->time, intobj->diff);
|
||||
timelib_time_dtor(dateobj->time);
|
||||
dateobj->time = new_time;
|
||||
|
||||
RETURN_ZVAL(object, 1, 0);
|
||||
}
|
||||
@@ -2923,7 +2915,7 @@ PHP_FUNCTION(date_sub)
|
||||
zval *object, *interval;
|
||||
php_date_obj *dateobj;
|
||||
php_interval_obj *intobj;
|
||||
int bias = 1;
|
||||
timelib_time *new_time;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
@@ -2938,24 +2930,9 @@ PHP_FUNCTION(date_sub)
|
||||
return;
|
||||
}
|
||||
|
||||
if (intobj->diff->invert) {
|
||||
bias = -1;
|
||||
}
|
||||
|
||||
memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
|
||||
dateobj->time->relative.y = 0 - (intobj->diff->y * bias);
|
||||
dateobj->time->relative.m = 0 - (intobj->diff->m * bias);
|
||||
dateobj->time->relative.d = 0 - (intobj->diff->d * bias);
|
||||
dateobj->time->relative.h = 0 - (intobj->diff->h * bias);
|
||||
dateobj->time->relative.i = 0 - (intobj->diff->i * bias);
|
||||
dateobj->time->relative.s = 0 - (intobj->diff->s * bias);
|
||||
dateobj->time->have_relative = 1;
|
||||
dateobj->time->sse_uptodate = 0;
|
||||
|
||||
timelib_update_ts(dateobj->time, NULL);
|
||||
timelib_update_from_sse(dateobj->time);
|
||||
|
||||
dateobj->time->have_relative = 0;
|
||||
new_time = timelib_sub(dateobj->time, intobj->diff);
|
||||
timelib_time_dtor(dateobj->time);
|
||||
dateobj->time = new_time;
|
||||
|
||||
RETURN_ZVAL(object, 1, 0);
|
||||
}
|
||||
@@ -3568,7 +3545,11 @@ zval *date_interval_read_property(zval *object, zval *member, int type, const ze
|
||||
ALLOC_INIT_ZVAL(retval);
|
||||
Z_SET_REFCOUNT_P(retval, 0);
|
||||
|
||||
ZVAL_LONG(retval, value);
|
||||
if (value != -99999) {
|
||||
ZVAL_LONG(retval, value);
|
||||
} else {
|
||||
ZVAL_FALSE(retval);
|
||||
}
|
||||
|
||||
if (member == &tmp_member) {
|
||||
zval_dtor(member);
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@ ZEND_END_MODULE_GLOBALS(date)
|
||||
#define DATEG(v) (date_globals.v)
|
||||
#endif
|
||||
|
||||
/* Backwards compability wrapper */
|
||||
/* Backwards compatibility wrapper */
|
||||
PHPAPI signed long php_parse_date(char *string, signed long *now);
|
||||
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
|
||||
PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Wrong var_dump(DateInterval->days) value
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interval = new DateInterval('P2Y4DT6H8M');
|
||||
|
||||
var_dump($interval->days);
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Test fix for DateTime when date have textual day with dot or other special char at end
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
//Set the default time zone
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
echo "*** Testing clone on DateTime objects ***\n";
|
||||
|
||||
// Create a DateTime object..
|
||||
$orig = new DateTime('2012-11-29 17:00:00');
|
||||
|
||||
// String to parse
|
||||
$string = "Thu., Nov. 29, 2012 5:00PM";
|
||||
|
||||
// Create a DateTime object from format
|
||||
$fromFormat = DateTime::createFromFormat( "D., M# j, Y g:iA", $string );
|
||||
|
||||
echo "Format method: " . $orig->format("D., M. j, Y g:iA") . "\n";
|
||||
echo "createFromFormat method: " . $fromFormat->format("D., M. j, Y g:iA") . "\n";
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing clone on DateTime objects ***
|
||||
Format method: Thu., Nov. 29, 2012 5:00PM
|
||||
createFromFormat method: Thu., Nov. 29, 2012 5:00PM
|
||||
===DONE===
|
||||
@@ -31,7 +31,7 @@ var_dump( $date->format( DateTime::W3C) ) ;
|
||||
--EXPECT--
|
||||
*** Testing date_format() : basic functionality - formatting coinstants ***
|
||||
string(25) "2005-07-14T22:30:41+01:00"
|
||||
string(32) "Thursday, 14-Jul-05 22:30:41 BST"
|
||||
string(34) "Thursday, 14-Jul-2005 22:30:41 BST"
|
||||
string(24) "2005-07-14T22:30:41+0100"
|
||||
string(29) "Thu, 14 Jul 05 22:30:41 +0100"
|
||||
string(32) "Thursday, 14-Jul-05 22:30:41 BST"
|
||||
|
||||
@@ -160,7 +160,7 @@ array(11) {
|
||||
["ATOM"]=>
|
||||
string(13) "Y-m-d\TH:i:sP"
|
||||
["COOKIE"]=>
|
||||
string(16) "l, d-M-y H:i:s T"
|
||||
string(16) "l, d-M-Y H:i:s T"
|
||||
["ISO8601"]=>
|
||||
string(13) "Y-m-d\TH:i:sO"
|
||||
["RFC822"]=>
|
||||
@@ -180,4 +180,4 @@ array(11) {
|
||||
["W3C"]=>
|
||||
string(13) "Y-m-d\TH:i:sP"
|
||||
}
|
||||
===DONE===
|
||||
===DONE===
|
||||
@@ -11,5 +11,5 @@ echo $a->format(DateTime::COOKIE);
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Thursday, 01-Jan-09 00:00:00 WET
|
||||
Thursday, 01-Jan-09 00:00:00 WET
|
||||
Thursday, 01-Jan-2009 00:00:00 WET
|
||||
Thursday, 01-Jan-2009 00:00:00 WET
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #53879 (DateTime::createFromFormat() fails to parse cookie expiration date)
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
$date = DateTime::createFromFormat(DateTime::COOKIE, "Mon, 21-Jan-2041 15:24:52 GMT");
|
||||
print_r($date);
|
||||
?>
|
||||
--EXPECTF--
|
||||
DateTime Object
|
||||
(
|
||||
[date] => 2041-01-21 15:24:52
|
||||
[timezone_type] => 2
|
||||
[timezone] => GMT
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Test for #63391 (Incorrect/inconsistent day of week prior to the year 1600)
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('date.timezone', 'UTC');
|
||||
|
||||
print "Date PHP\n";
|
||||
print "---------- ---\n";
|
||||
$dates = array('1599-12-30', '1599-12-31', '1600-01-01', '1600-01-02');
|
||||
foreach ($dates as $date) {
|
||||
echo date_create($date)->format('Y-m-d D'), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Date PHP
|
||||
---------- ---
|
||||
1599-12-30 Thu
|
||||
1599-12-31 Fri
|
||||
1600-01-01 Sat
|
||||
1600-01-02 Sun
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Test for bug #64157: DateTime::createFromFormat() reports confusing error message
|
||||
--CREDITS--
|
||||
Boro Sitnikovski <buritomath@yahoo.com>
|
||||
--INI--
|
||||
date.timezone = UTC
|
||||
--FILE--
|
||||
<?php
|
||||
DateTime::createFromFormat('s', '0');
|
||||
$lastErrors = DateTime::getLastErrors();
|
||||
print_r($lastErrors['errors'][0]);
|
||||
?>
|
||||
--EXPECT--
|
||||
A two digit second could not be found
|
||||
@@ -41,8 +41,8 @@ Date constants
|
||||
--EXPECT--
|
||||
string(25) "2006-07-01T14:27:30+02:00"
|
||||
string(25) "2006-05-30T14:32:13+02:00"
|
||||
string(33) "Saturday, 01-Jul-06 14:27:30 CEST"
|
||||
string(32) "Tuesday, 30-May-06 14:32:13 CEST"
|
||||
string(35) "Saturday, 01-Jul-2006 14:27:30 CEST"
|
||||
string(34) "Tuesday, 30-May-2006 14:32:13 CEST"
|
||||
string(24) "2006-07-01T14:27:30+0200"
|
||||
string(24) "2006-05-30T14:32:13+0200"
|
||||
string(29) "Sat, 01 Jul 06 14:27:30 +0200"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Test for Date/Time construction during a forward DST transition
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set('America/New_York');
|
||||
|
||||
$date = new DateTime('2010-03-14 01:30:00');
|
||||
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
||||
|
||||
$date = new DateTime('2010-03-14 02:00:00');
|
||||
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
||||
|
||||
$date = new DateTime('2010-03-14 02:30:00');
|
||||
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
||||
|
||||
$date = new DateTime('2010-03-14 03:00:00');
|
||||
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
||||
|
||||
$date = new DateTime('2010-03-14 03:30:00');
|
||||
echo $date->format('Y-m-d H:i:s T/e - U') . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
2010-03-14 01:30:00 EST/America/New_York - 1268548200
|
||||
2010-03-14 03:00:00 EDT/America/New_York - 1268550000
|
||||
2010-03-14 03:30:00 EDT/America/New_York - 1268551800
|
||||
2010-03-14 03:00:00 EDT/America/New_York - 1268550000
|
||||
2010-03-14 03:30:00 EDT/America/New_York - 1268551800
|
||||
@@ -45,7 +45,7 @@ string(25) "2008-08-08T08:08:08+00:00"
|
||||
string(%d) "%s"
|
||||
|
||||
--DATE_COOKIE Constant--
|
||||
string(30) "Friday, 08-Aug-08 08:08:08 GMT"
|
||||
string(32) "Friday, 08-Aug-2008 08:08:08 GMT"
|
||||
string(%d) "%s"
|
||||
|
||||
--DATE_RFC822 Constant--
|
||||
@@ -79,4 +79,4 @@ string(%d) "%s"
|
||||
--DATE_W3C Constant--
|
||||
string(25) "2008-08-08T08:08:08+00:00"
|
||||
string(%d) "%s"
|
||||
===DONE===
|
||||
===DONE===
|
||||
@@ -0,0 +1,96 @@
|
||||
--TEST--
|
||||
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, ba)
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$date_format = 'Y-m-d H:i:s T e';
|
||||
$interval_format = 'P%dDT%hH';
|
||||
|
||||
/*
|
||||
* Backward Transitions, add().
|
||||
*/
|
||||
|
||||
$start = new DateTime('2010-11-07 01:59:59');
|
||||
$interval_spec = 'PT1S';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba1 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT24H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT23H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT22H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT21H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 01:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 01:30:00');
|
||||
$interval_spec = 'P1DT1H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT25H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 03:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 02:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York
|
||||
ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York
|
||||
ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York
|
||||
ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST America/New_York
|
||||
ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York
|
||||
ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York
|
||||
ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York
|
||||
ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 02:30:00 EST America/New_York
|
||||
ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York
|
||||
ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York
|
||||
ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd1)
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$date_format = 'Y-m-d H:i:s T e';
|
||||
$interval_format = 'P%dDT%hH';
|
||||
|
||||
/*
|
||||
* Backward Transitions, diff().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-11-07 05:30:00');
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 04:30:00');
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 03:30:00');
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 02:30:00');
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00');
|
||||
$start = new DateTime('2010-11-06 01:30:00');
|
||||
echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
bd1 2010-11-07 05:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT1H
|
||||
bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H
|
||||
bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H
|
||||
bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H
|
||||
bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H
|
||||
@@ -0,0 +1,56 @@
|
||||
--TEST--
|
||||
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2)
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Still not quite right
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$date_format = 'Y-m-d H:i:s T e';
|
||||
$interval_format = 'P%dDT%hH';
|
||||
|
||||
/*
|
||||
* For backward transitions, must create objects with zone type 2
|
||||
* where specifying Daylight or Standard time is required
|
||||
* then converting them to zone type 3.
|
||||
*/
|
||||
|
||||
$tz = new DateTimeZone('America/New_York');
|
||||
|
||||
/*
|
||||
* Backward Transitions, diff().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-11-07 05:30:00');
|
||||
$end->setTimeZone($tz);
|
||||
$start = new DateTime('2010-11-06 04:30:59');
|
||||
echo 'bd0 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format('P%dDT%hH%iM%sS') . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EDT');
|
||||
$end->setTimeZone($tz);
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$start = new DateTime('2010-11-06 01:30:00');
|
||||
echo 'bd8 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S
|
||||
bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H
|
||||
bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
|
||||
bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H
|
||||
@@ -0,0 +1,92 @@
|
||||
--TEST--
|
||||
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bs)
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$tz = new DateTimeZone('America/New_York');
|
||||
$date_format = 'Y-m-d H:i:s T e';
|
||||
$interval_format = 'P%dDT%hH';
|
||||
|
||||
/*
|
||||
* Backward Transitions, sub().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-11-07 01:00:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$interval_spec = 'PT1S';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs1 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 04:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs2 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 03:30:00');
|
||||
$interval_spec = 'PT24H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs3 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 02:30:00');
|
||||
$interval_spec = 'PT23H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs4 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$interval_spec = 'PT22H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs5 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EDT');
|
||||
$end->setTimeZone($tz);
|
||||
$interval_spec = 'PT21H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs6 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs7 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$interval_spec = 'P1DT1H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs8 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 03:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs9 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 02:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs10 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bs1 2010-11-07 01:00:00 EST America/New_York - PT1S = 2010-11-07 01:59:59 EDT America/New_York
|
||||
bs2 2010-11-07 04:30:00 EST America/New_York - P1D = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs3 2010-11-07 03:30:00 EST America/New_York - PT24H = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs4 2010-11-07 02:30:00 EST America/New_York - PT23H = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs5 2010-11-07 01:30:00 EST America/New_York - PT22H = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs6 2010-11-07 01:30:00 EDT America/New_York - PT21H = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs7 2010-11-07 01:30:00 EDT America/New_York - P1D = 2010-11-06 01:30:00 EDT America/New_York
|
||||
bs8 2010-11-07 01:30:00 EST America/New_York - P1DT1H = 2010-11-06 00:30:00 EDT America/New_York
|
||||
bs9 2010-11-07 03:30:00 EST America/New_York - P1D = 2010-11-06 03:30:00 EDT America/New_York
|
||||
bs10 2010-11-07 02:30:00 EST America/New_York - P1D = 2010-11-06 02:30:00 EDT America/New_York
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fa)
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$date_format = 'Y-m-d H:i:s T e';
|
||||
$interval_format = 'P%dDT%hH';
|
||||
|
||||
/*
|
||||
* Forward Transitions, add().
|
||||
*/
|
||||
|
||||
$start = new DateTime('2010-03-14 01:59:59');
|
||||
$interval_spec = 'PT1S';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
$interval_spec = 'PT22H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
$interval_spec = 'PT21H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 01:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 02:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York
|
||||
fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York
|
||||
fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York
|
||||
fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York
|
||||
fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York
|
||||
fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fd)
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$date_format = 'Y-m-d H:i:s T e';
|
||||
$interval_format = 'P%dDT%hH';
|
||||
|
||||
/*
|
||||
* Forward Transitions, diff().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-03-14 03:00:00');
|
||||
$start = new DateTime('2010-03-14 01:59:59');
|
||||
echo 'fd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 04:30:00');
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
echo 'fd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 03:30:00');
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
echo 'fd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 01:30:00');
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
echo 'fd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 01:30:00');
|
||||
$start = new DateTime('2010-03-13 01:30:00');
|
||||
echo 'fd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 03:30:00');
|
||||
$start = new DateTime('2010-03-13 03:30:00');
|
||||
echo 'fd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 03:30:00');
|
||||
$start = new DateTime('2010-03-13 02:30:00');
|
||||
echo 'fd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
fd1 2010-03-14 03:00:00 EDT America/New_York - 2010-03-14 01:59:59 EST America/New_York = PT0H0M1S
|
||||
fd2 2010-03-14 04:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P1DT0H
|
||||
fd3 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT22H
|
||||
fd4 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT21H
|
||||
fd5 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 01:30:00 EST America/New_York = P1DT0H
|
||||
fd6 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 03:30:00 EST America/New_York = P1DT0H
|
||||
fd7 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 02:30:00 EST America/New_York = P1DT1H
|
||||
@@ -0,0 +1,67 @@
|
||||
--TEST--
|
||||
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs)
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
Still not quite right
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$date_format = 'Y-m-d H:i:s T e';
|
||||
$interval_format = 'P%dDT%hH';
|
||||
|
||||
/*
|
||||
* Forward Transitions, sub().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-03-14 03:00:00');
|
||||
$interval_spec = 'PT1S';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs1 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 04:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs2 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 03:30:00');
|
||||
$interval_spec = 'PT22H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs3 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 01:30:00');
|
||||
$interval_spec = 'PT21H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs4 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 01:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs5 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-15 03:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs6 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-15 02:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs7 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York
|
||||
fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York
|
||||
fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York
|
||||
fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York
|
||||
fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York
|
||||
fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
|
||||
fs7 2010-03-15 02:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
|
||||
@@ -1,399 +0,0 @@
|
||||
--TEST--
|
||||
RFC: DateTime and Daylight Saving Time Transitions (zone type 3)
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--XFAIL--
|
||||
RFC not implemented yet
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('America/New_York');
|
||||
$date_format = 'Y-m-d H:i:s T e';
|
||||
$interval_format = 'P%dDT%hH';
|
||||
|
||||
/*
|
||||
* Forward Transitions, diff().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-03-14 03:00:00');
|
||||
$start = new DateTime('2010-03-14 01:59:59');
|
||||
echo 'fd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 04:30:00');
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
echo 'fd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 03:30:00');
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
echo 'fd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 01:30:00');
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
echo 'fd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 01:30:00');
|
||||
$start = new DateTime('2010-03-13 01:30:00');
|
||||
echo 'fd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 03:30:00');
|
||||
$start = new DateTime('2010-03-13 03:30:00');
|
||||
echo 'fd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 03:30:00');
|
||||
$start = new DateTime('2010-03-13 02:30:00');
|
||||
echo 'fd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
/*
|
||||
* Forward Transitions, add().
|
||||
*/
|
||||
|
||||
$start = new DateTime('2010-03-14 01:59:59');
|
||||
$interval_spec = 'PT1S';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
$interval_spec = 'PT22H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 04:30:00');
|
||||
$interval_spec = 'PT21H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 01:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-03-13 02:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
/*
|
||||
* Forward Transitions, sub().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-03-14 03:00:00');
|
||||
$interval_spec = 'PT1S';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs1 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 04:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs2 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 03:30:00');
|
||||
$interval_spec = 'PT22H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs3 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 01:30:00');
|
||||
$interval_spec = 'PT21H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs4 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-14 01:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs5 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-15 03:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs6 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-03-15 02:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'fs7 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
|
||||
/*
|
||||
* For backward transitions, must create objects with zone type 2
|
||||
* where specifying Daylight or Standard time is required
|
||||
* then converting them to zone type 3.
|
||||
*/
|
||||
|
||||
$tz = new DateTimeZone('America/New_York');
|
||||
|
||||
/*
|
||||
* Backward Transitions, diff().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-11-07 01:00:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$start = new DateTime('2010-11-07 01:59:59');
|
||||
echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 04:30:00');
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 03:30:00');
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 02:30:00');
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EDT');
|
||||
$end->setTimeZone($tz);
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00');
|
||||
$start = new DateTime('2010-11-06 01:30:00');
|
||||
echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$start = new DateTime('2010-11-06 01:30:00');
|
||||
echo 'bd8 ' . $end->format($date_format) . ' - ' . $start->format($date_format)
|
||||
. ' = ' . $start->diff($end)->format($interval_format) . "\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
/*
|
||||
* Backward Transitions, add().
|
||||
*/
|
||||
|
||||
$start = new DateTime('2010-11-07 01:59:59');
|
||||
$interval_spec = 'PT1S';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba1 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT24H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT23H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT22H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT21H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 01:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 01:30:00');
|
||||
$interval_spec = 'P1DT1H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 04:30:00');
|
||||
$interval_spec = 'PT25H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 03:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
$start = new DateTime('2010-11-06 02:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = "
|
||||
. $start->add($interval)->format($date_format) . "\n";
|
||||
|
||||
echo "\n";
|
||||
|
||||
/*
|
||||
* Backward Transitions, sub().
|
||||
*/
|
||||
|
||||
$end = new DateTime('2010-11-07 01:00:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$interval_spec = 'PT1S';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs1 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 04:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs2 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 03:30:00');
|
||||
$interval_spec = 'PT24H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs3 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 02:30:00');
|
||||
$interval_spec = 'PT23H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs4 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$interval_spec = 'PT22H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs5 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EDT');
|
||||
$end->setTimeZone($tz);
|
||||
$interval_spec = 'PT21H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs6 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs7 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 01:30:00 EST');
|
||||
$end->setTimeZone($tz);
|
||||
$interval_spec = 'P1DT1H';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs8 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 03:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs9 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
$end = new DateTime('2010-11-07 02:30:00');
|
||||
$interval_spec = 'P1D';
|
||||
$interval = new DateInterval($interval_spec);
|
||||
echo 'bs10 ' . $end->format($date_format) . " - $interval_spec = "
|
||||
. $end->sub($interval)->format($date_format) . "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
fd1 2010-03-14 03:00:00 EDT America/New_York - 2010-03-14 01:59:59 EST America/New_York = PT0H0M1S
|
||||
fd2 2010-03-14 04:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P1DT0H
|
||||
fd3 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT22H
|
||||
fd4 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT21H
|
||||
fd5 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 01:30:00 EST America/New_York = P1DT0H
|
||||
fd6 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 03:30:00 EST America/New_York = P1DT0H
|
||||
fd7 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 02:30:00 EST America/New_York = P1DT1H
|
||||
|
||||
fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York
|
||||
fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York
|
||||
fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York
|
||||
fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York
|
||||
fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York
|
||||
fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York
|
||||
|
||||
fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York
|
||||
fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York
|
||||
fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York
|
||||
fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York
|
||||
fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York
|
||||
fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
|
||||
fs7 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York
|
||||
|
||||
bd1 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S
|
||||
bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H
|
||||
bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H
|
||||
bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H
|
||||
bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H
|
||||
bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H
|
||||
bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H
|
||||
bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H
|
||||
|
||||
ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York
|
||||
ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York
|
||||
ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York
|
||||
ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST America/New_York
|
||||
ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York
|
||||
ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York
|
||||
ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York
|
||||
ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 01:30:00 EST America/New_York
|
||||
ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York
|
||||
ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York
|
||||
ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York
|
||||
|
||||
bs1 2010-11-07 01:00:00 EST America/New_York - PT1S = 2010-11-07 01:59:59 EDT America/New_York
|
||||
bs2 2010-11-07 04:30:00 EST America/New_York - P1D = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs3 2010-11-07 03:30:00 EST America/New_York - PT24H = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs4 2010-11-07 02:30:00 EST America/New_York - PT23H = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs5 2010-11-07 01:30:00 EST America/New_York - PT22H = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs6 2010-11-07 01:30:00 EDT America/New_York - PT21H = 2010-11-06 04:30:00 EDT America/New_York
|
||||
bs7 2010-11-07 01:30:00 EDT America/New_York - P1D = 2010-11-06 01:30:00 EDT America/New_York
|
||||
bs8 2010-11-07 01:30:00 EST America/New_York - P1DT1H = 2010-11-06 00:30:00 EDT America/New_York
|
||||
bs9 2010-11-07 03:30:00 EST America/New_York - P1D = 2010-11-06 03:30:00 EDT America/New_York
|
||||
bs10 2010-11-07 02:30:00 EST America/New_York - P1D = 2010-11-06 02:30:00 EDT America/New_York
|
||||
@@ -53,7 +53,7 @@ bool(false)
|
||||
string(31) "Fri, 16 Jun 2006 23:49:12 +0100"
|
||||
bool(false)
|
||||
string(31) "Fri, 16 Jun 2006 02:22:00 +0100"
|
||||
string(31) "Mon, 16 Jun 0222 02:22:00 -0036"
|
||||
string(31) "Sun, 16 Jun 0222 02:22:00 -0036"
|
||||
string(31) "Fri, 16 Jun 2006 02:22:33 +0100"
|
||||
bool(false)
|
||||
string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
|
||||
|
||||
@@ -32,8 +32,8 @@ object(DateTime)#2 (3) {
|
||||
string(6) "+02:00"
|
||||
}
|
||||
|
||||
string(16) "l, d-M-y H:i:s T"
|
||||
string(36) "Tuesday, 08-Jul-08 22:14:12 GMT+0200"
|
||||
string(16) "l, d-M-Y H:i:s T"
|
||||
string(38) "Tuesday, 08-Jul-2008 22:14:12 GMT+0200"
|
||||
object(DateTime)#1 (3) {
|
||||
["date"]=>
|
||||
string(19) "2008-07-08 22:14:12"
|
||||
|
||||
+25
-10
@@ -226,12 +226,17 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
|
||||
*key_free = *key_str;
|
||||
return len;
|
||||
} else {
|
||||
*key_free = NULL;
|
||||
zval tmp = *key;
|
||||
int len;
|
||||
|
||||
convert_to_string(key);
|
||||
*key_str = Z_STRVAL_P(key);
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_string(&tmp);
|
||||
|
||||
return Z_STRLEN_P(key);
|
||||
*key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
|
||||
len = Z_STRLEN(tmp);
|
||||
|
||||
zval_dtor(&tmp);
|
||||
return len;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -297,6 +302,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
/* the same check, but with a call to DBA_ID_DONE before returning */
|
||||
#define DBA_WRITE_CHECK_WITH_ID \
|
||||
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \
|
||||
DBA_ID_DONE; \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ globals */
|
||||
@@ -538,7 +551,6 @@ PHP_MINFO_FUNCTION(dba)
|
||||
*/
|
||||
static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
{
|
||||
char *v;
|
||||
int val_len;
|
||||
zval *id;
|
||||
dba_info *info = NULL;
|
||||
@@ -558,7 +570,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
|
||||
DBA_FETCH_RESOURCE(info, &id);
|
||||
|
||||
DBA_WRITE_CHECK;
|
||||
DBA_WRITE_CHECK_WITH_ID;
|
||||
|
||||
if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) {
|
||||
DBA_ID_DONE;
|
||||
@@ -613,7 +625,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
char *file_mode;
|
||||
char mode[4], *pmode, *lock_file_mode = NULL;
|
||||
int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0;
|
||||
char *opened_path, *lock_name;
|
||||
char *opened_path = NULL;
|
||||
char *lock_name;
|
||||
|
||||
if(ac < 2) {
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -836,8 +849,10 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
if (!persistent) {
|
||||
info->lock.name = opened_path;
|
||||
} else {
|
||||
info->lock.name = pestrdup(opened_path, persistent);
|
||||
efree(opened_path);
|
||||
if (opened_path) {
|
||||
info->lock.name = pestrdup(opened_path, persistent);
|
||||
efree(opened_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1111,7 +1126,7 @@ PHP_FUNCTION(dba_delete)
|
||||
{
|
||||
DBA_ID_GET2;
|
||||
|
||||
DBA_WRITE_CHECK;
|
||||
DBA_WRITE_CHECK_WITH_ID;
|
||||
|
||||
if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS)
|
||||
{
|
||||
|
||||
@@ -460,7 +460,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
|
||||
*/
|
||||
static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC)
|
||||
{
|
||||
size_t pos_grp_start, pos_grp_next;
|
||||
size_t pos_grp_start = 0, pos_grp_next;
|
||||
inifile *ini_tmp = NULL;
|
||||
php_stream *fp_tmp = NULL;
|
||||
int ret;
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
|
||||
$db = dba_popen($db_filename, 'c');
|
||||
|
||||
$key = 1;
|
||||
$copy = $key;
|
||||
|
||||
echo gettype($key)."\n";
|
||||
echo gettype($copy)."\n";
|
||||
|
||||
dba_exists($key, $db);
|
||||
|
||||
echo gettype($key)."\n";
|
||||
echo gettype($copy)."\n";
|
||||
|
||||
dba_close($db);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
integer
|
||||
integer
|
||||
integer
|
||||
integer
|
||||
+17
-2
@@ -2296,7 +2296,7 @@ PHP_FUNCTION(dom_document_save_html)
|
||||
xmlBufferPtr buf;
|
||||
dom_object *intern, *nodeobj;
|
||||
xmlChar *mem = NULL;
|
||||
int size, format;
|
||||
int size = 0, format;
|
||||
dom_doc_propsptr doc_props;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
|
||||
@@ -2324,7 +2324,22 @@ PHP_FUNCTION(dom_document_save_html)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
size = htmlNodeDump(buf, docp, node);
|
||||
if (node->type == XML_DOCUMENT_FRAG_NODE) {
|
||||
int one_size;
|
||||
|
||||
for (node = node->children; node; node = node->next) {
|
||||
one_size = htmlNodeDump(buf, docp, node);
|
||||
|
||||
if (one_size >= 0) {
|
||||
size += one_size;
|
||||
} else {
|
||||
size = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
size = htmlNodeDump(buf, docp, node);
|
||||
}
|
||||
if (size >= 0) {
|
||||
mem = (xmlChar*) xmlBufferContent(buf);
|
||||
if (!mem) {
|
||||
|
||||
@@ -1089,7 +1089,11 @@ void dom_xpath_objects_free_storage(void *object TSRMLS_DC)
|
||||
void dom_objects_free_storage(void *object TSRMLS_DC)
|
||||
{
|
||||
dom_object *intern = (dom_object *)object;
|
||||
#if defined(__GNUC__) && __GNUC__ >= 3
|
||||
int retcount __attribute__((unused)); /* keep compiler quiet */
|
||||
#else
|
||||
int retcount;
|
||||
#endif
|
||||
|
||||
zend_object_std_dtor(&intern->std TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #44648 (Attribute names not checked for wellformedness)
|
||||
Bug #44648 (Attribute names not checked for well formedness)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML() Produces invalid Markup)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("dom") or die("skip need ext/dom");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dom = new DOMDocument();
|
||||
|
||||
$frag1 = $dom->createDocumentFragment();
|
||||
var_dump($dom->saveHTML($frag1));
|
||||
|
||||
$frag2 = $dom->createDocumentFragment();
|
||||
$div = $dom->createElement('div');
|
||||
$div->appendChild($dom->createElement('span'));
|
||||
$frag2->appendChild($div);
|
||||
$frag2->appendChild($dom->createElement('div'));
|
||||
$frag2->appendChild($dom->createElement('div'));
|
||||
var_dump($dom->saveHTML($frag2));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
string(46) "<div><span></span></div><div></div><div></div>"
|
||||
===DONE===
|
||||
+1
-1
@@ -74,7 +74,7 @@ const zend_function_entry php_dom_xpath_class_functions[] = {
|
||||
|
||||
static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */
|
||||
{
|
||||
zval **args;
|
||||
zval **args = NULL;
|
||||
zval *retval;
|
||||
int result, i, ret;
|
||||
int error = 0;
|
||||
|
||||
+13
-6
@@ -2643,6 +2643,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
} else {
|
||||
decode = ImageInfo->decode_unicode_le;
|
||||
}
|
||||
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
|
||||
if (zend_multibyte_encoding_converter(
|
||||
(unsigned char**)pszInfoPtr,
|
||||
&len,
|
||||
@@ -2650,7 +2651,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
ByteCount,
|
||||
zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
|
||||
zend_multibyte_fetch_encoding(decode TSRMLS_CC)
|
||||
TSRMLS_CC) < 0) {
|
||||
TSRMLS_CC) == (size_t)-1) {
|
||||
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
|
||||
}
|
||||
return len;
|
||||
@@ -2663,6 +2664,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
*pszEncoding = estrdup((const char*)szValuePtr);
|
||||
szValuePtr = szValuePtr+8;
|
||||
ByteCount -= 8;
|
||||
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
|
||||
if (zend_multibyte_encoding_converter(
|
||||
(unsigned char**)pszInfoPtr,
|
||||
&len,
|
||||
@@ -2670,7 +2672,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
ByteCount,
|
||||
zend_multibyte_fetch_encoding(ImageInfo->encode_jis TSRMLS_CC),
|
||||
zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le TSRMLS_CC)
|
||||
TSRMLS_CC) < 0) {
|
||||
TSRMLS_CC) == (size_t)-1) {
|
||||
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
|
||||
}
|
||||
return len;
|
||||
@@ -2700,8 +2702,8 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC)
|
||||
{
|
||||
xp_field->tag = tag;
|
||||
|
||||
/* Copy the comment */
|
||||
|
||||
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
|
||||
if (zend_multibyte_encoding_converter(
|
||||
(unsigned char**)&xp_field->value,
|
||||
&xp_field->size,
|
||||
@@ -2709,7 +2711,7 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
|
||||
ByteCount,
|
||||
zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
|
||||
zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le TSRMLS_CC)
|
||||
TSRMLS_CC) < 0) {
|
||||
TSRMLS_CC) == (size_t)-1) {
|
||||
xp_field->size = exif_process_string_raw(&xp_field->value, szValuePtr, ByteCount);
|
||||
}
|
||||
return xp_field->size;
|
||||
@@ -2850,7 +2852,12 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel);
|
||||
/* If its bigger than 4 bytes, the dir entry contains an offset. */
|
||||
value_ptr = offset_base+offset_val;
|
||||
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry) {
|
||||
/*
|
||||
dir_entry is ImageInfo->file.list[sn].data+2+i*12
|
||||
offset_base is ImageInfo->file.list[sn].data-dir_offset
|
||||
dir_entry - offset_base is dir_offset+2+i*12
|
||||
*/
|
||||
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) {
|
||||
/* It is important to check for IMAGE_FILETYPE_TIFF
|
||||
* JPEG does not use absolute pointers instead its pointers are
|
||||
* relative to the start of the TIFF header in APP1 section. */
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
||||
<html><head>
|
||||
<title>301 Moved Permanently</title>
|
||||
</head><body>
|
||||
<h1>Moved Permanently</h1>
|
||||
<p>The document has moved <a href="http://www.getid3.org/temp/62523.jpg">here</a>.</p>
|
||||
<hr>
|
||||
<address>Apache Server at getid3.org Port 80</address>
|
||||
</body></html>
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug 62523 (php crashes with segfault when exif_read_data called)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("exif") or die("skip need exif");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
var_dump(count(exif_read_data(__DIR__."/bug62523_1.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Test
|
||||
|
||||
Warning: exif_read_data(bug62523_1.jpg): File not supported in %sbug62523_1.php on line %d
|
||||
int(1)
|
||||
Done
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 KiB |
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug 62523 (php crashes with segfault when exif_read_data called)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("exif") or die("skip need exif");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
var_dump(count(exif_read_data(__DIR__."/bug62523_2.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
Test
|
||||
int(76)
|
||||
Done
|
||||
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head><title>Found</title></head>
|
||||
<body>
|
||||
<h1>Found</h1>
|
||||
<p>The resource was found at <a href="http://dl.dropboxusercontent.com/u/7562584/Bugs/Php/bad_exif.jpeg">http://dl.dropboxusercontent.com/u/7562584/Bugs/Php/bad_exif.jpeg</a>;
|
||||
you should be redirected automatically.
|
||||
|
||||
<!-- --></p>
|
||||
<hr noshade>
|
||||
<div align="right">WSGI Server</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug 62523 (php crashes with segfault when exif_read_data called)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("exif") or die("skip need exif");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
var_dump(count(exif_read_data(__DIR__."/bug62523_3.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Test
|
||||
|
||||
Warning: exif_read_data(bug62523_3.jpg): File not supported in %sbug62523_3.php on line %d
|
||||
int(1)
|
||||
Done
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
PHP crash when zend_multibyte_encoding_converter returns (size_t)-1)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/exif_encoding_crash.jpg';
|
||||
$exif_data = exif_read_data($infile);
|
||||
echo "*** no core dump ***\n";
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
*** no core dump ***
|
||||
===DONE===
|
||||
@@ -11969,7 +11969,7 @@
|
||||
#>65 string ZSYS (Pre-System 7 system file)
|
||||
#>65 string acf3 (Aldus FreeHand)
|
||||
#>65 string cdev (control panel)
|
||||
#>65 string dfil (Desk Acessory suitcase)
|
||||
#>65 string dfil (Desk Accessory suitcase)
|
||||
#>65 string libr (library)
|
||||
#>65 string nX^d (WriteNow word processor)
|
||||
#>65 string nX^w (WriteNow dictionary)
|
||||
|
||||
@@ -484,10 +484,6 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
if (*(e - 1) == '.') {
|
||||
goto bad_url;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -718,8 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
if (flags & FILTER_FLAG_NO_RES_RANGE) {
|
||||
if (
|
||||
(ip[0] == 0) ||
|
||||
(ip[0] == 128 && ip[1] == 0) ||
|
||||
(ip[0] == 191 && ip[1] == 255) ||
|
||||
(ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) ||
|
||||
(ip[0] == 169 && ip[1] == 254) ||
|
||||
(ip[0] == 192 && ip[1] == 0 && ip[2] == 2) ||
|
||||
(ip[0] == 127 && ip[1] == 0 && ip[2] == 0 && ip[3] == 1) ||
|
||||
|
||||
Loaded 100 of 405 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user