mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-21 16:06:37 +00:00
Compare commits
283
Commits
php-7.1.1
...
php-7.0.18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa587915da | ||
|
|
c51ecac617 | ||
|
|
825f006117 | ||
|
|
4d375b3bd0 | ||
|
|
5b12d08e1f | ||
|
|
ee8b5de5a0 | ||
|
|
6da475367a | ||
|
|
1f8fc0fb56 | ||
|
|
867c29caf0 | ||
|
|
eb5d4bcd4f | ||
|
|
eb13003f6c | ||
|
|
d719b46222 | ||
|
|
f5951cc81b | ||
|
|
0fb640c717 | ||
|
|
1517fdb36c | ||
|
|
1dbef2e27a | ||
|
|
bc2b500d3e | ||
|
|
6d066dc421 | ||
|
|
2e83082605 | ||
|
|
df135ffa7a | ||
|
|
53e2c9158d | ||
|
|
183cd048f1 | ||
|
|
0c8ad36d92 | ||
|
|
98f4ce9363 | ||
|
|
7fba8bda4c | ||
|
|
8be63ce0e2 | ||
|
|
b9d3dbc84e | ||
|
|
960e5cde02 | ||
|
|
ba70478a21 | ||
|
|
8e5d080d54 | ||
|
|
f0e67d1a56 | ||
|
|
411f4b1b6f | ||
|
|
760ff21bf3 | ||
|
|
53cc72ef86 | ||
|
|
17e9fc9bfe | ||
|
|
8e45583006 | ||
|
|
29ee3e3c49 | ||
|
|
c398198c0a | ||
|
|
9b16d4c999 | ||
|
|
177f87cf05 | ||
|
|
247ce052cd | ||
|
|
b224e74267 | ||
|
|
bab0b99f37 | ||
|
|
549a30d2cd | ||
|
|
648b756f35 | ||
|
|
c082c92b7e | ||
|
|
18f7e26257 | ||
|
|
c7b2c698d0 | ||
|
|
fab5ce347c | ||
|
|
cf60f26da6 | ||
|
|
61e9b7354f | ||
|
|
29333550d2 | ||
|
|
e80ea04c79 | ||
|
|
dfcb11d7d1 | ||
|
|
53a08fd07d | ||
|
|
868930e079 | ||
|
|
21a05b0418 | ||
|
|
c564924d31 | ||
|
|
008fb28eaf | ||
|
|
bbfa1b6419 | ||
|
|
eac8166bd4 | ||
|
|
9450e23b32 | ||
|
|
ff8a6b1232 | ||
|
|
cc10515056 | ||
|
|
e9873d9853 | ||
|
|
330a7b62c3 | ||
|
|
1d4eead995 | ||
|
|
015a80ef7b | ||
|
|
9eaf551c86 | ||
|
|
593a4d8fe9 | ||
|
|
bd7e5c1548 | ||
|
|
c836ad1c7e | ||
|
|
1623ef10c9 | ||
|
|
513582814b | ||
|
|
61e59db99d | ||
|
|
cf3ef36323 | ||
|
|
708973c9bd | ||
|
|
3b91ed112f | ||
|
|
5432d6f982 | ||
|
|
e79754dee3 | ||
|
|
89a5bd6750 | ||
|
|
3917350531 | ||
|
|
eb1373e509 | ||
|
|
f0519f4837 | ||
|
|
26fdebc63b | ||
|
|
01c1afa79f | ||
|
|
ee25eb0eae | ||
|
|
981c58705a | ||
|
|
7e5cf2aa19 | ||
|
|
9814be4bc2 | ||
|
|
db7c0badd4 | ||
|
|
185304a61e | ||
|
|
80c8d84af3 | ||
|
|
7a0adb4cd2 | ||
|
|
714d825b62 | ||
|
|
044dd30440 | ||
|
|
fd521a22f7 | ||
|
|
8a8aa67844 | ||
|
|
9ea0949f43 | ||
|
|
21d7878690 | ||
|
|
dcaf4da8a6 | ||
|
|
9ffc6ca62f | ||
|
|
6988d070ea | ||
|
|
4df993d89d | ||
|
|
75ad2b301a | ||
|
|
0b56ba51d0 | ||
|
|
25271feeb0 | ||
|
|
8faf5f979c | ||
|
|
dd9cf23457 | ||
|
|
acda2563ce | ||
|
|
a15bffd105 | ||
|
|
570a273807 | ||
|
|
6fc0ae638a | ||
|
|
1d7f8eb693 | ||
|
|
74c95fb3fb | ||
|
|
3446e3b749 | ||
|
|
69a2e4ece2 | ||
|
|
3f89b630b4 | ||
|
|
15e9aa1706 | ||
|
|
8dfa428ccd | ||
|
|
15404bda13 | ||
|
|
2cd0d8b711 | ||
|
|
ec43a11581 | ||
|
|
d9ca5d9637 | ||
|
|
0e21d8066b | ||
|
|
aa9742d80d | ||
|
|
163bb87897 | ||
|
|
5b5130c4ff | ||
|
|
536b3ca1e1 | ||
|
|
543141ae3b | ||
|
|
f39cabe610 | ||
|
|
bf0f53270f | ||
|
|
368958b3e4 | ||
|
|
dd227c2b23 | ||
|
|
62938bf088 | ||
|
|
4b1afc829c | ||
|
|
2b7e5468c9 | ||
|
|
df16579642 | ||
|
|
2fcf1259c6 | ||
|
|
a3d3f76827 | ||
|
|
f65ae82c55 | ||
|
|
a15c1990eb | ||
|
|
721a189742 | ||
|
|
737ee0661c | ||
|
|
c44efbbbb1 | ||
|
|
80a851b4dd | ||
|
|
d636467937 | ||
|
|
6f912f7c04 | ||
|
|
71efe9d8fd | ||
|
|
e56fe7e5e7 | ||
|
|
42d53f3bc0 | ||
|
|
f67d599a01 | ||
|
|
8da8756312 | ||
|
|
21ac79e94b | ||
|
|
2e3d68ed1b | ||
|
|
f81b7df618 | ||
|
|
cad2598fcb | ||
|
|
8c75dbc498 | ||
|
|
cf649f59cb | ||
|
|
8ba6d622e5 | ||
|
|
f9226f9bf3 | ||
|
|
fb8486f3bd | ||
|
|
280e9cb28d | ||
|
|
e7e96fe2e0 | ||
|
|
6af7753e36 | ||
|
|
6af22d0d3e | ||
|
|
a22f181736 | ||
|
|
e00c2f335c | ||
|
|
db894fa6aa | ||
|
|
3f960255f4 | ||
|
|
5d07438cb3 | ||
|
|
d2274b01cb | ||
|
|
f1b2afc9d9 | ||
|
|
b28c2e20ca | ||
|
|
e0ca519a8b | ||
|
|
6477bb724e | ||
|
|
50b38322b9 | ||
|
|
cc9893eb44 | ||
|
|
2c7909697a | ||
|
|
814966ad33 | ||
|
|
43d0f2abc5 | ||
|
|
0ab1af7d3e | ||
|
|
4f19bb7af6 | ||
|
|
60aff0bd30 | ||
|
|
fbf655afbd | ||
|
|
a4accc0e3e | ||
|
|
aaaef22db6 | ||
|
|
8e993b427c | ||
|
|
3500262b7d | ||
|
|
fd92b91188 | ||
|
|
04379bcb1d | ||
|
|
bd75f9e613 | ||
|
|
1ee1f79e27 | ||
|
|
ef42f49470 | ||
|
|
b2782c6dc5 | ||
|
|
51d487786c | ||
|
|
d9cd2876d9 | ||
|
|
13edec75a3 | ||
|
|
07340553a5 | ||
|
|
291e3f0762 | ||
|
|
ad9c552b12 | ||
|
|
15837bab8c | ||
|
|
6a9efa2d3e | ||
|
|
dcaed51ba0 | ||
|
|
1bdffee820 | ||
|
|
125ee6a68e | ||
|
|
69fbe3a9ad | ||
|
|
69058f35f8 | ||
|
|
14c72cc582 | ||
|
|
9ad3413190 | ||
|
|
7e49e8e797 | ||
|
|
28f2959b83 | ||
|
|
f1ad170a15 | ||
|
|
add4f43f0e | ||
|
|
ef7e5e0d69 | ||
|
|
4f1b24d974 | ||
|
|
63e08cbef7 | ||
|
|
b655f2d632 | ||
|
|
f7cb79431f | ||
|
|
8dd523a216 | ||
|
|
8c653c163a | ||
|
|
b8215c0817 | ||
|
|
47007455dc | ||
|
|
5b5483dc8e | ||
|
|
7f1247004e | ||
|
|
c75287dc85 | ||
|
|
eb02876e74 | ||
|
|
5df97b339e | ||
|
|
b36f4ac708 | ||
|
|
ec1b7b933d | ||
|
|
5146d9f8ac | ||
|
|
a46bbdda2e | ||
|
|
f346bd6ee6 | ||
|
|
2cb8950cc2 | ||
|
|
fc777296bf | ||
|
|
486fc0424a | ||
|
|
80a5ae4f53 | ||
|
|
49a0c166f3 | ||
|
|
d0279242ce | ||
|
|
b351ec8baf | ||
|
|
21f287915c | ||
|
|
574f7bc3d4 | ||
|
|
98c2cd4311 | ||
|
|
41c1d0291c | ||
|
|
3401f553b9 | ||
|
|
f98d8f6c15 | ||
|
|
4568618030 | ||
|
|
71e84e2c36 | ||
|
|
1516132167 | ||
|
|
826122fa8e | ||
|
|
e55e93a1e3 | ||
|
|
699ab98f9d | ||
|
|
62e9e1fecd | ||
|
|
9a0dac124e | ||
|
|
053b966134 | ||
|
|
ad08aa3956 | ||
|
|
ba0751a915 | ||
|
|
2d42423953 | ||
|
|
3a79f35fdc | ||
|
|
ff6b309c6f | ||
|
|
b0ff9ee688 | ||
|
|
6a03b43e5f | ||
|
|
a49aaf9ab0 | ||
|
|
12bbeaa45e | ||
|
|
8e39a27b76 | ||
|
|
4f1335cd4c | ||
|
|
49b2cbf763 | ||
|
|
81fb61f97c | ||
|
|
782b84c6d5 | ||
|
|
66b698c3cf | ||
|
|
db890956ec | ||
|
|
a7c444b939 | ||
|
|
a43a3798d3 | ||
|
|
3b14d7b84b | ||
|
|
372144508c | ||
|
|
183a34a5cf | ||
|
|
995ecffbb2 | ||
|
|
e7f23e164b | ||
|
|
c36ce04dd3 | ||
|
|
650e073f7a | ||
|
|
2edf296a92 | ||
|
|
a2c461d58a | ||
|
|
2ece3ea699 |
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.0beta1
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.0beta2
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
|
||||
@@ -29,22 +29,33 @@ document ____executor_globals
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
____executor_globals
|
||||
set $p = $eg.current_execute_data.CVs
|
||||
set $c = $eg.current_execute_data.op_array.last_var
|
||||
set $v = $eg.current_execute_data.op_array.vars
|
||||
set $i = 0
|
||||
|
||||
printf "Compiled variables count: %d\n", $c
|
||||
while $i < $c
|
||||
printf "%d = %s\n", $i, $v[$i].name
|
||||
if $p[$i] != 0
|
||||
printzv *$p[$i]
|
||||
else
|
||||
printf "*uninitialized*\n"
|
||||
end
|
||||
set $i = $i + 1
|
||||
if $argc == 0
|
||||
____executor_globals
|
||||
set $cv_ex_ptr = $eg.current_execute_data
|
||||
else
|
||||
set $cv_ex_ptr = (zend_execute_data *)$arg0
|
||||
end
|
||||
set $cv_count = $cv_ex_ptr.func.op_array.last_var
|
||||
set $cv = $cv_ex_ptr.func.op_array.vars
|
||||
set $cv_idx = 0
|
||||
set $callFrameSize = (sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval)
|
||||
|
||||
printf "Compiled variables count: %d\n\n", $cv_count
|
||||
while $cv_idx < $cv_count
|
||||
printf "[%d] '%s'\n", $cv_idx, $cv[$cv_idx].val
|
||||
set $zvalue = ((zval *) $cv_ex_ptr) + $callFrameSize + $cv_idx
|
||||
printzv $zvalue
|
||||
set $cv_idx = $cv_idx + 1
|
||||
end
|
||||
end
|
||||
|
||||
document print_cvs
|
||||
Prints the compiled variables and their values.
|
||||
If a zend_execute_data pointer is set this will print the compiled
|
||||
variables of that scope. If no parameter is used it will use
|
||||
current_execute_data for scope.
|
||||
|
||||
usage: print_cvs [zend_execute_data *]
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
@@ -196,12 +207,17 @@ define ____printzv_contents
|
||||
____executor_globals
|
||||
set $handle = $zvalue->value.obj.handle
|
||||
set $handlers = $zvalue->value.obj.handlers
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
printf "(%s) #%d", $cname, $handle
|
||||
if ! $arg1
|
||||
if $handlers->get_properties == &zend_std_get_properties
|
||||
set $ht = $zobj->properties
|
||||
if $zobj->properties
|
||||
set $ht = $zobj->properties
|
||||
else
|
||||
set $ht = &$zobj->ce->properties_info
|
||||
end
|
||||
printf "\nProperties "
|
||||
if $ht
|
||||
set $ind = $ind + 1
|
||||
____print_ht $ht 1
|
||||
@@ -212,7 +228,7 @@ define ____printzv_contents
|
||||
set $i = $i - 1
|
||||
end
|
||||
else
|
||||
echo "no properties found"
|
||||
echo "not found"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -455,9 +471,9 @@ define print_inh
|
||||
end
|
||||
|
||||
define print_pi
|
||||
set $pi = $arg0
|
||||
set $pi = (zend_property_info *)$arg0
|
||||
printf "[%p] {\n", $pi
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
@@ -476,16 +492,27 @@ define print_pi
|
||||
end
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
____print_str $pi->name $pi->name_length
|
||||
printf "\n}\n"
|
||||
print_zstr $pi->name
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_pi
|
||||
Takes a pointer to an object's property and prints the property information
|
||||
usage: print_pi <ptr>
|
||||
end
|
||||
|
||||
define ____print_str
|
||||
set $tmp = 0
|
||||
set $str = $arg0
|
||||
if $argc > 2
|
||||
set $maxlen = $arg2
|
||||
else
|
||||
set $maxlen = 256
|
||||
end
|
||||
|
||||
printf "\""
|
||||
while $tmp < $arg1 && $tmp < 256
|
||||
if $str[$tmp] > 32 && $str[$tmp] < 127
|
||||
while $tmp < $arg1 && $tmp < $maxlen
|
||||
if $str[$tmp] > 31 && $str[$tmp] < 127
|
||||
printf "%c", $str[$tmp]
|
||||
else
|
||||
printf "\\%o", $str[$tmp]
|
||||
@@ -554,6 +581,23 @@ document printzops
|
||||
dump operands of the current opline
|
||||
end
|
||||
|
||||
define print_zstr
|
||||
set $zstr = (zend_string *)$arg0
|
||||
if $argc == 2
|
||||
set $maxlen = $arg1
|
||||
else
|
||||
set $maxlen = $zstr->len
|
||||
end
|
||||
printf "string(%d) ", $zstr->len
|
||||
____print_str $zstr->val $zstr->len $maxlen
|
||||
printf "\n"
|
||||
end
|
||||
|
||||
document print_zstr
|
||||
print the length and contents of a zend string
|
||||
usage: print_zstr <ptr> [max length]
|
||||
end
|
||||
|
||||
define zbacktrace
|
||||
____executor_globals
|
||||
dump_bt $eg.current_execute_data
|
||||
@@ -566,79 +610,6 @@ document zbacktrace
|
||||
> (gdb) dump_bt $eg.current_execute_data
|
||||
end
|
||||
|
||||
define zmemcheck
|
||||
set $p = alloc_globals.head
|
||||
set $stat = "?"
|
||||
set $total_size = 0
|
||||
if $arg0 != 0
|
||||
set $not_found = 1
|
||||
else
|
||||
set $not_found = 0
|
||||
end
|
||||
printf " block size status file:line\n"
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
while $p
|
||||
set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test)
|
||||
if $arg0 == 0 || (void *)$aptr == (void *)$arg0
|
||||
if $p->magic == 0x7312f8dc
|
||||
set $stat = "OK"
|
||||
end
|
||||
if $p->magic == 0x99954317
|
||||
set $stat = "FREED"
|
||||
end
|
||||
if $p->magic == 0xfb8277dc
|
||||
set $stat = "CACHED"
|
||||
end
|
||||
set $filename = strrchr($p->filename->val, '/')
|
||||
if !$filename
|
||||
set $filename = $p->filename->val
|
||||
else
|
||||
set $filename = $filename + 1
|
||||
end
|
||||
printf " %p ", $aptr
|
||||
if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10
|
||||
printf "ZVAL?(%-2d) ", $p->size
|
||||
else
|
||||
printf "%-9d ", $p->size
|
||||
end
|
||||
set $total_size = $total_size + $p->size
|
||||
printf "%-06s %s:%d", $stat, $filename, $p->lineno
|
||||
if $p->orig_filename
|
||||
set $orig_filename = strrchr($p->orig_filename, '/')
|
||||
if !$orig_filename
|
||||
set $orig_filename = $p->orig_filename
|
||||
else
|
||||
set $orig_filename = $orig_filename + 1
|
||||
end
|
||||
printf " <= %s:%d\n", $orig_filename, $p->orig_lineno
|
||||
else
|
||||
printf "\n"
|
||||
end
|
||||
if $arg0 != 0
|
||||
set $p = 0
|
||||
set $not_found = 0
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
printf " total: %d bytes\n", $total_size
|
||||
end
|
||||
end
|
||||
|
||||
document zmemcheck
|
||||
show status of a memory block.
|
||||
usage: zmemcheck [ptr].
|
||||
if ptr is 0, all blocks will be listed.
|
||||
end
|
||||
|
||||
define lookup_root
|
||||
set $found = 0
|
||||
if gc_globals->roots
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>, Christoph M. Becker <cmb@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ install-headers:
|
||||
paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
|
||||
done; \
|
||||
$(mkinstalldirs) $$paths && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
for i in `echo $(INSTALL_HEADERS)`; do \
|
||||
if test "$(PHP_PECL_EXTENSION)"; then \
|
||||
src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
|
||||
|
||||
@@ -1,8 +1,197 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2017 PHP 7.0.16
|
||||
13 Apr 2017 PHP 7.0.18
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73370 (falsely exits with "Out of Memory" when using
|
||||
USE_ZEND_ALLOC=0). (Nikita)
|
||||
. Fixed bug #73960 (Leak with instance method calling static method with
|
||||
referenced return). (Nikita)
|
||||
. Fixed bug #74265 (Build problems after 7.0.17 release: undefined reference
|
||||
to `isfinite'). (Nikita)
|
||||
. Fixed bug #74302 (yield fromLABEL is over-greedy). (Sara)
|
||||
|
||||
- Apache:
|
||||
. Reverted patch for bug #61471, fixes bug #74318. (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #72096 (Swatch time value incorrect for dates before 1970). (mcq8)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #74004 (LIBXML_NOWARNING flag ingnored on loadHTML*).
|
||||
(somedaysummer)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #74230 (iconv fails to fail on surrogates). (Anatol)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #72333 (fwrite() on non-blocking SSL sockets doesn't work).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- PDO MySQL:
|
||||
. Fixed bug #71003 (Expose MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT to PDO
|
||||
interface). (Thomas Orozco)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #74216 (Correctly fail on invalid IP address ports). (Sara)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #74240 (deflate_add can allocate too much memory). (Matt Bonneau)
|
||||
|
||||
16 Mar 2017 PHP 7.0.17
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73989 (PHP 7.1 Segfaults within Symfony test suite).
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #74084 (Out of bound read - zend_mm_alloc_small). (Laruence)
|
||||
. Fixed bug #73807 (Performance problem with processing large post request).
|
||||
(Nikita)
|
||||
. Fixed bug #73998 (array_key_exists fails on arrays created by
|
||||
get_object_vars). (mhagstrand)
|
||||
. Fixed bug #73954 (NAN check fails on Alpine Linux with musl). (Andrea)
|
||||
. Fixed bug #74039 (is_infinite(-INF) returns false). (Christian Schmidt)
|
||||
. Fixed bug #73677 (Generating phar.phar core dump with gcc ASAN enabled
|
||||
build). (ondrej)
|
||||
|
||||
- Apache:
|
||||
. Fixed bug #61471 (Incomplete POST does not timeout but is passed to PHP).
|
||||
(Zheng Shao)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #72719 (Relative datetime format ignores weekday on sundays
|
||||
only). (Derick)
|
||||
. Fixed bug #73294 (DateTime wrong when date string is negative). (Derick)
|
||||
. Fixed bug #73489 (wrong timestamp when call setTimeZone multi times with
|
||||
UTC offset). (xiami, Derick)
|
||||
. Fixed bug #73858 (first/last day of' flag is not being reset). (Derick)
|
||||
. Fixed bug #73942 ($date->modify('Friday this week') doesn't return a Friday
|
||||
if $date is a Sunday). (Derick)
|
||||
. Fixed bug #74057 (wrong day when using "this week" in strtotime). (Derick)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #69860 (php-fpm process accounting is broken with keepalive).
|
||||
(Denis Yeldandi)
|
||||
|
||||
- Hash:
|
||||
. Fixed bug #73127 (gost-crypto hash incorrect if input data contains long
|
||||
0xFF sequence). (Grundik)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74031 (ReflectionFunction for imagepng is missing last two
|
||||
parameters). (finwe)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #74021 (fetch_array broken data. Data more then MEDIUMBLOB).
|
||||
(Andrew Nester, Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74152 (if statement says true to a null variable). (Laruence)
|
||||
. Fixed bug #74019 (Segfault with list). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74022 (PHP Fast CGI crashes when reading from a pfx file).
|
||||
(Anatol)
|
||||
|
||||
- PDO_OCI:
|
||||
. Fixed bug #54379 (PDO_OCI: UTF-8 output gets truncated). (gureedo / Oracle)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74148 (ReflectionFunction incorrectly reports the number of
|
||||
arguments). (Laruence)
|
||||
. Fixed bug #74005 (mail.add_x_header causes RFC-breaking lone line feed).
|
||||
(Anatol)
|
||||
. Fixed bug #73118 (is_callable callable name reports misleading value for
|
||||
anonymous classes). (Adam Saponara)
|
||||
. Fixed bug #74105 (PHP on Linux should use /dev/urandom when getrandom is
|
||||
not available). (Benjamin Robin)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #73496 (Invalid memory access in zend_inline_hash_func).
|
||||
(Laruence)
|
||||
. Fixed bug #74090 (stream_get_contents maxlength>-1 returns empty string).
|
||||
(Anatol)
|
||||
|
||||
|
||||
16 Feb 2017 PHP 7.0.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73916 (zend_print_flat_zval_r doesn't consider reference).
|
||||
(Laruence)
|
||||
. Fixed bug #73876 (Crash when exporting **= in expansion of assign op).
|
||||
(Sara)
|
||||
. Fixed bug #73969 (segfault in debug_print_backtrace). (andrewnester)
|
||||
. Fixed bug #73973 (assertion error in debug_zval_dump). (andrewnester)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes).
|
||||
(aboks)
|
||||
|
||||
- DTrace:
|
||||
. Fixed bug #73965 (DTrace reported as enabled when disabled). (Remi)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #67583 (double fastcgi_end_request on max_children limit).
|
||||
(Dmitry Saprykin)
|
||||
. Fixed bug #69865 (php-fpm does not close stderr when using syslog).
|
||||
(m6w6)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73968 (Premature failing of XBM reading). (cmb)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #69993 (test for gmp.h needs to test machine includes).
|
||||
(Jordan Gigov)
|
||||
|
||||
- Intl:
|
||||
. Fix bug #73956 (Link use CC instead of CXX). (Remi)
|
||||
|
||||
- LDAP:
|
||||
. Fixed bug #73933 (error/segfault with ldap_mod_replace and opcache).
|
||||
(Laruence)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #73949 (leak in mysqli_fetch_object). (krakjoe)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #69899 (segfault on close() after free_result() with mysqlnd).
|
||||
(Richard Fussenegger)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #73983 (crash on finish work with phar in cli + opcache).
|
||||
(Anatol)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #71519 (add serial hex to return value array). (xrobau)
|
||||
|
||||
- PDO_Firebird:
|
||||
. Implemented FR #72583 (All data are fetched as strings). (Dorin Marcoci)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #73959 (lastInsertId fails to throw an exception for wrong
|
||||
sequence name). (andrewnester)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #70417 (PharData::compress() doesn't close temp file). (cmb)
|
||||
|
||||
- posix:
|
||||
. Fixed bug #71219 (configure script incorrectly checks for ttyname_r). (atoth)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #69582 (session not readable by root in CLI). (EvgeniySpinov)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73896 (spl_autoload() crashes when calls magic _call()). (Dmitry)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #69442 (closing of fd incorrect when PTS enabled). (jaytaph)
|
||||
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
|
||||
"Transfer-Encoding: chunked"). (Rowan Collins)
|
||||
. Fixed bug #72974 (imap is undefined service on AIX). (matthieu.sarter)
|
||||
. Fixed bug #72979 (money_format stores wrong length AIX). (matthieu.sarter)
|
||||
|
||||
- ZIP:
|
||||
. Fixed bug #70103 (ZipArchive::addGlob ignores remove_all_path option). (cmb,
|
||||
Mitch Hagstrand)
|
||||
|
||||
19 Jan 2017 PHP 7.0.15
|
||||
|
||||
@@ -13,6 +202,15 @@ PHP NEWS
|
||||
. Fixed bug #73585 (Logging of "Internal Zend error - Missing class
|
||||
information" missing class name). (Laruence)
|
||||
. Fixed bug #73753 (unserialized array pointer not advancing). (David Walker)
|
||||
. Fixed bug #73825 (Heap out of bounds read on unserialize in
|
||||
finish_nested_data()). (Stas)
|
||||
. Fixed bug #73831 (NULL Pointer Dereference while unserialize php object).
|
||||
(Stas)
|
||||
. Fixed bug #73832 (Use of uninitialized memory in unserialize()). (Stas)
|
||||
. Fixed bug #73092 (Unserialize use-after-free when resizing object's
|
||||
properties hash table). (Nikita)
|
||||
. Fixed bug #69425 (Use After Free in unserialize()). (Nikita)
|
||||
. Fixed bug #72731 (Type Confusion in Object Deserialization). (Nikita)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #73679 (DOTNET read access violation using invalid codepage).
|
||||
@@ -21,6 +219,17 @@ PHP NEWS
|
||||
- DOM:
|
||||
. Fixed bug #67474 (getElementsByTagNameNS filter on default ns). (aboks)
|
||||
|
||||
- EXIF:
|
||||
. Bug bug #73737 (FPE when parsing a tag format). (Stas)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73869 (Signed Integer Overflow gd_io.c). (cmb)
|
||||
. Fixed bug #73868 (DOS vulnerability in gdImageCreateFromGd2Ctx()). (cmb)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #70513 (GMP Deserialization Type Confusion Vulnerability).
|
||||
(Nikita)
|
||||
|
||||
- Mysqli:
|
||||
. Fixed bug #73462 (Persistent connections don't set $connect_errno).
|
||||
(darkain)
|
||||
@@ -38,9 +247,10 @@ PHP NEWS
|
||||
. Fixed bug #72931 (PDO_FIREBIRD with Firebird 3.0 not work on returning
|
||||
statement). (Dorin Marcoci)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #73586 (php_user_filter::$stream is not set to the stream the
|
||||
filter is working on). (Dmitry)
|
||||
- Phar:
|
||||
. Fixed bug #73773 (Seg fault when loading hostile phar). (Stas)
|
||||
. Fixed bug #73768 (Memory corruption when loading hostile phar). (Stas)
|
||||
. Fixed bug #73764 (Crash while loading hostile phar archive). (Stas)
|
||||
|
||||
- Phpdbg:
|
||||
. Fixed bug #73615 (phpdbg without option never load .phpdbginit at startup).
|
||||
@@ -51,6 +261,10 @@ PHP NEWS
|
||||
- Reflection:
|
||||
. Fixed bug #46103 (ReflectionObject memory leak). (Nikita)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #73586 (php_user_filter::$stream is not set to the stream the
|
||||
filter is working on). (Dmitry)
|
||||
|
||||
- SQLite3:
|
||||
. Reverted fix for bug #73530 (Unsetting result set may reset other result
|
||||
set). (cmb)
|
||||
|
||||
+12
-9
@@ -93,24 +93,27 @@ Commit the changes to the main branch.
|
||||
12. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
|
||||
13. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
13. run ``scripts/dev/gen_verify_stub <version> [identity]``, this will sign the tarballs
|
||||
and output verification information to be included in announcement email
|
||||
|
||||
14. 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 or Dan.
|
||||
|
||||
14. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
15. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
f.e. http://downloads.php.net/derick/
|
||||
|
||||
15. Once the release has been tagged, contact the PHP Windows development team
|
||||
16. 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.
|
||||
|
||||
Getting the non stable release (alpha/beta/RC) announced
|
||||
--------------------------------------------------------
|
||||
|
||||
1. Send an email (see example here: http://news.php.net/php.internals/19486)
|
||||
**To** ``internals@lists.php.net`` and ``php-general@lists.php.net`` lists
|
||||
pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release".
|
||||
1. Send an email **To** ``internals@lists.php.net`` and ``php-general@lists.php.net``
|
||||
lists pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release". Include in this information the verification
|
||||
information output by ``gen_verify_stub``.
|
||||
|
||||
2. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
|
||||
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
|
||||
@@ -190,8 +193,8 @@ Check if the pear files are updated (phar).
|
||||
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
|
||||
|
||||
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.
|
||||
12. Once the release has been tagged, contact release managers, windows builders, and package maintainers
|
||||
so that they can build releases. Do not send this announcement to any public lists.
|
||||
|
||||
Getting the stable release announced
|
||||
------------------------------------
|
||||
|
||||
@@ -652,6 +652,11 @@ Other
|
||||
Since 7.0.9, getenv() has optional second parameter, making it only
|
||||
consider local environment and not SAPI environment if true.
|
||||
|
||||
- fopen()
|
||||
Since 7.0.16, mode 'e' was added, which sets the close-on-exec flag
|
||||
on the opened file descriptor. This mode is only available in PHP compiled on
|
||||
POSIX.1-2008 conform systems.
|
||||
|
||||
========================================
|
||||
6. New Functions
|
||||
========================================
|
||||
@@ -722,6 +727,13 @@ out, that the corresponding SDK isn't available anymore.
|
||||
Mhash is not an extension anymore, use function_exists("mhash") to check whether
|
||||
it is avaliable.
|
||||
|
||||
- PDO_Firebird
|
||||
As of PHP 7.0.16, the fetched data for integer fields is aware of the Firebird
|
||||
datatypes. Previously all integers was fetched as strings, starting with the
|
||||
aforementioned PHP version integer fields are translated to the PHP integer
|
||||
datatype. The 64-bit integers are still fetched as strings in 32-bit PHP
|
||||
builds.
|
||||
|
||||
- GD
|
||||
The bundled libgd requires libwebp instead of libvpx for the WebP functionality.
|
||||
|
||||
@@ -788,6 +800,7 @@ out, that the corresponding SDK isn't available anymore.
|
||||
. Removed asp_tags ini directive. Trying to enable it will result in a fatal
|
||||
error.
|
||||
. Removed always_populate_raw_post_data ini directive.
|
||||
. realpath_cache_size set to 4096k by default
|
||||
|
||||
========================================
|
||||
12. Windows Support
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
|
||||
AC_ZEND_BROKEN_SPRINTF
|
||||
|
||||
AC_CHECK_FUNCS(finite isfinite isinf isnan)
|
||||
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
|
||||
|
||||
ZEND_FP_EXCEPT
|
||||
|
||||
|
||||
+8
-8
@@ -64,33 +64,33 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
/* To enable the is_nan, is_infinite and is_finite PHP functions */
|
||||
#ifdef NETWARE
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#define HAVE_DECL_ISNAN 1
|
||||
#define HAVE_DECL_ISINF 1
|
||||
#define HAVE_DECL_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#ifdef HAVE_ISNAN
|
||||
#if HAVE_DECL_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#define zend_isnan(a) ((a) != (a))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#if HAVE_DECL_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
ZEND_POW_ASSIGN
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert_options(ASSERT_WARNING);
|
||||
assert(false && ($a **= 2));
|
||||
--EXPECTF--
|
||||
Warning: assert(): assert(false && ($a **= 2)) failed in %s%ezend-pow-assign.php on line %d
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #73916 (zend_print_flat_zval_r doesn't consider reference)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array('a');
|
||||
class b{};
|
||||
$b = new b;
|
||||
$test[] =& $a;
|
||||
$test[] =& $b;
|
||||
test($test);
|
||||
function test() {
|
||||
debug_print_backtrace();
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 test(Array ([0] => Array ([0] => a),[1] => b Object ())) called at [%sbug73916.php:%d]
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #73954 (NAN check fails on Alpine Linux with musl)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(NAN);
|
||||
var_dump(is_nan(NAN));
|
||||
|
||||
function takes_int(int $int) {
|
||||
}
|
||||
|
||||
takes_int(log(tan(3.14)));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
float(NAN)
|
||||
bool(true)
|
||||
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type integer, float given, called in %s on line 9 and defined in %s:6
|
||||
Stack trace:
|
||||
#0 %s(9): takes_int(NAN)
|
||||
#1 {main}
|
||||
thrown in %s on line 6
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #73960: Leak with instance method calling static method with referenced return
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$value = 'one';
|
||||
$array = array($value);
|
||||
$array = $ref =& $array;
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "one"
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #73989 (PHP 7.1 Segfaults within Symfony test suite)
|
||||
--FILE--
|
||||
<?php
|
||||
class Cycle
|
||||
{
|
||||
private $thing;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$obj = $this;
|
||||
$this->thing = function() use($obj) {};
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
($this->thing)();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10000; ++$i) {
|
||||
$obj = new Cycle();
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #73998 (array_key_exists fails on arrays created by get_object_vars)
|
||||
--DESCRIPTION--
|
||||
Properties of objects with numeric names should be accessible
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass;
|
||||
$a->{1234} = "Numeric";
|
||||
$a->a1234 = "String";
|
||||
|
||||
$properties = get_object_vars($a);
|
||||
var_dump(array_key_exists(1234, $properties));
|
||||
echo "Value: {$properties[1234]}\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
Value: Numeric
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #74084 (Out of bound read - zend_mm_alloc_small)
|
||||
--INI--
|
||||
error_reporting=0
|
||||
--FILE--
|
||||
<?php
|
||||
$$A += $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A -= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A *= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A /= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A **= $$B->a = &$$C;
|
||||
var_dump($$A);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Use of non-literals in declare ticks values crashes compiler
|
||||
--FILE--
|
||||
<?php
|
||||
declare(ticks = UNKNOWN_CONST) {
|
||||
echo 'Done';
|
||||
}
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
yield from parses too greedily
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function from1234($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
function bar() {
|
||||
yield 24;
|
||||
}
|
||||
|
||||
function foo() {
|
||||
yield from1234(42);
|
||||
yield from(bar());
|
||||
}
|
||||
|
||||
foreach (foo() as $value) {
|
||||
var_dump($value);
|
||||
}
|
||||
--EXPECT--
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -152,6 +152,7 @@ ZEND_TSRMLS_CACHE_DEFINE()
|
||||
#endif
|
||||
|
||||
ZEND_API zend_utility_values zend_uv;
|
||||
ZEND_API zend_bool zend_dtrace_enabled;
|
||||
|
||||
/* version information */
|
||||
static char *zend_version_info;
|
||||
@@ -312,6 +313,9 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
|
||||
ZEND_PUTS(")");
|
||||
break;
|
||||
}
|
||||
case IS_REFERENCE:
|
||||
zend_print_flat_zval_r(Z_REFVAL_P(expr));
|
||||
break;
|
||||
default:
|
||||
zend_print_variable(expr);
|
||||
break;
|
||||
@@ -563,6 +567,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
|
||||
#ifdef ZEND_WIN32
|
||||
zend_get_windows_version_info(&executor_globals->windows_version_info);
|
||||
#endif
|
||||
executor_globals->valid_symbol_table = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -682,6 +687,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
char *tmp = getenv("USE_ZEND_DTRACE");
|
||||
|
||||
if (tmp && zend_atoi(tmp, 0)) {
|
||||
zend_dtrace_enabled = 1;
|
||||
zend_compile_file = dtrace_compile_file;
|
||||
zend_execute_ex = dtrace_execute_ex;
|
||||
zend_execute_internal = dtrace_execute_internal;
|
||||
|
||||
@@ -299,6 +299,8 @@ extern ZEND_API zend_class_entry *zend_standard_class_def;
|
||||
extern ZEND_API zend_utility_values zend_uv;
|
||||
extern ZEND_API zval zval_used_for_init;
|
||||
|
||||
/* If DTrace is available and enabled */
|
||||
extern ZEND_API zend_bool zend_dtrace_enabled;
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_UV(name) (zend_uv.name)
|
||||
|
||||
+2
-2
@@ -2862,7 +2862,7 @@ static ZEND_COLD ZEND_NORETURN void zend_out_of_memory(void)
|
||||
ZEND_API void * __zend_malloc(size_t len)
|
||||
{
|
||||
void *tmp = malloc(len);
|
||||
if (EXPECTED(tmp)) {
|
||||
if (EXPECTED(tmp || !len)) {
|
||||
return tmp;
|
||||
}
|
||||
zend_out_of_memory();
|
||||
@@ -2878,7 +2878,7 @@ ZEND_API void * __zend_calloc(size_t nmemb, size_t len)
|
||||
ZEND_API void * __zend_realloc(void *p, size_t len)
|
||||
{
|
||||
p = realloc(p, len);
|
||||
if (EXPECTED(p)) {
|
||||
if (EXPECTED(p || !len)) {
|
||||
return p;
|
||||
}
|
||||
zend_out_of_memory();
|
||||
|
||||
+15
-4
@@ -57,17 +57,21 @@ ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
|
||||
return (zend_ast *) ast;
|
||||
}
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
|
||||
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno) {
|
||||
zend_ast_zval *ast;
|
||||
|
||||
ast = zend_ast_alloc(sizeof(zend_ast_zval));
|
||||
ast->kind = ZEND_AST_ZVAL;
|
||||
ast->attr = attr;
|
||||
ZVAL_COPY_VALUE(&ast->val, zv);
|
||||
ast->val.u2.lineno = CG(zend_lineno);
|
||||
ast->val.u2.lineno = lineno;
|
||||
return (zend_ast *) ast;
|
||||
}
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
|
||||
return zend_ast_create_zval_with_lineno(zv, attr, CG(zend_lineno));
|
||||
}
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_decl(
|
||||
zend_ast_kind kind, uint32_t flags, uint32_t start_lineno, zend_string *doc_comment,
|
||||
zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2, zend_ast *child3
|
||||
@@ -155,7 +159,14 @@ ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind ki
|
||||
uint32_t i;
|
||||
va_start(va, kind);
|
||||
for (i = 0; i < init_children; ++i) {
|
||||
ast = zend_ast_list_add(ast, va_arg(va, zend_ast *));
|
||||
zend_ast *child = va_arg(va, zend_ast *);
|
||||
ast = zend_ast_list_add(ast, child);
|
||||
if (child != NULL) {
|
||||
uint32_t lineno = zend_ast_get_lineno(child);
|
||||
if (lineno < ast->lineno) {
|
||||
ast->lineno = lineno;
|
||||
}
|
||||
}
|
||||
}
|
||||
va_end(va);
|
||||
}
|
||||
@@ -1344,7 +1355,7 @@ simple_list:
|
||||
case ZEND_ASSIGN_BW_OR: BINARY_OP(" |= ", 90, 91, 90);
|
||||
case ZEND_ASSIGN_BW_AND: BINARY_OP(" &= ", 90, 91, 90);
|
||||
case ZEND_ASSIGN_BW_XOR: BINARY_OP(" ^= ", 90, 91, 90);
|
||||
case ZEND_POW: BINARY_OP(" **= ", 90, 91, 90);
|
||||
case ZEND_ASSIGN_POW: BINARY_OP(" **= ", 90, 91, 90);
|
||||
EMPTY_SWITCH_DEFAULT_CASE();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -190,6 +190,7 @@ typedef struct _zend_ast_decl {
|
||||
typedef void (*zend_ast_process_t)(zend_ast *ast);
|
||||
extern ZEND_API zend_ast_process_t zend_ast_process;
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno);
|
||||
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr);
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_ex(zend_ast_kind kind, zend_ast_attr attr, ...);
|
||||
|
||||
@@ -808,9 +808,6 @@ static void copy_constant_array(zval *dst, zval *src) /* {{{ */
|
||||
}
|
||||
} else if (Z_REFCOUNTED_P(val)) {
|
||||
Z_ADDREF_P(val);
|
||||
if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_RESOURCE_EX)) {
|
||||
Z_TYPE_INFO_P(new_val) &= ~(IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
@@ -853,12 +850,7 @@ repeat:
|
||||
case IS_FALSE:
|
||||
case IS_TRUE:
|
||||
case IS_NULL:
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
ZVAL_COPY(&val_free, val);
|
||||
/* TODO: better solution than this tricky disable dtor on resource? */
|
||||
Z_TYPE_INFO(val_free) &= ~(IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
|
||||
val = &val_free;
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
if (!Z_IMMUTABLE_P(val)) {
|
||||
@@ -1154,6 +1146,8 @@ ZEND_FUNCTION(get_object_vars)
|
||||
HashTable *properties;
|
||||
zend_string *key;
|
||||
zend_object *zobj;
|
||||
zend_ulong index;
|
||||
zend_bool fast_copy = 0;
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_OBJECT(obj)
|
||||
@@ -1172,7 +1166,17 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zobj = Z_OBJ_P(obj);
|
||||
|
||||
if (!zobj->ce->default_properties_count && properties == zobj->properties && !ZEND_HASH_GET_APPLY_COUNT(properties)) {
|
||||
/* fast copy */
|
||||
fast_copy = 1;
|
||||
/* Check if the object has a numeric property, See Bug 73998 */
|
||||
ZEND_HASH_FOREACH_STR_KEY(properties, key) {
|
||||
if (key && ZEND_HANDLE_NUMERIC(key, index)) {
|
||||
fast_copy = 0;
|
||||
break;
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
|
||||
if (fast_copy) {
|
||||
if (EXPECTED(zobj->handlers == &std_object_handlers)) {
|
||||
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
GC_REFCOUNT(properties)++;
|
||||
@@ -1198,7 +1202,7 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_len);
|
||||
zend_hash_str_add_new(Z_ARRVAL_P(return_value), prop_name, prop_len, value);
|
||||
} else {
|
||||
zend_hash_add_new(Z_ARRVAL_P(return_value), key, value);
|
||||
zend_symbtable_add_new(Z_ARRVAL_P(return_value), key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2364,13 +2368,19 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
object = Z_OBJ(call->This);
|
||||
|
||||
if (call->func) {
|
||||
zend_string *zend_function_name;
|
||||
|
||||
func = call->func;
|
||||
function_name = (func->common.scope &&
|
||||
func->common.scope->trait_aliases) ?
|
||||
ZSTR_VAL(zend_resolve_method_name(
|
||||
(object ? object->ce : func->common.scope), func)) :
|
||||
(func->common.function_name ?
|
||||
ZSTR_VAL(func->common.function_name) : NULL);
|
||||
if (func->common.scope && func->common.scope->trait_aliases) {
|
||||
zend_function_name = zend_resolve_method_name(object ? object->ce : func->common.scope, func);
|
||||
} else {
|
||||
zend_function_name = func->common.function_name;
|
||||
}
|
||||
if (zend_function_name != NULL) {
|
||||
function_name = ZSTR_VAL(zend_function_name);
|
||||
} else {
|
||||
function_name = NULL;
|
||||
}
|
||||
} else {
|
||||
func = NULL;
|
||||
function_name = NULL;
|
||||
|
||||
+8
-2
@@ -1574,6 +1574,7 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
|
||||
{
|
||||
zval zv;
|
||||
int retval;
|
||||
uint32_t start_lineno;
|
||||
|
||||
if (CG(increment_lineno)) {
|
||||
CG(zend_lineno)++;
|
||||
@@ -1582,6 +1583,7 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
|
||||
|
||||
again:
|
||||
ZVAL_UNDEF(&zv);
|
||||
start_lineno = CG(zend_lineno);
|
||||
retval = lex_scan(&zv);
|
||||
if (EG(exception)) {
|
||||
return T_ERROR;
|
||||
@@ -1605,7 +1607,7 @@ again:
|
||||
break;
|
||||
}
|
||||
if (Z_TYPE(zv) != IS_UNDEF) {
|
||||
elem->ast = zend_ast_create_zval(&zv);
|
||||
elem->ast = zend_ast_create_zval_with_lineno(&zv, 0, start_lineno);
|
||||
}
|
||||
|
||||
return retval;
|
||||
@@ -4366,8 +4368,12 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
|
||||
zend_ast *declare_ast = declares->child[i];
|
||||
zend_ast *name_ast = declare_ast->child[0];
|
||||
zend_ast *value_ast = declare_ast->child[1];
|
||||
|
||||
zend_string *name = zend_ast_get_str(name_ast);
|
||||
|
||||
if (value_ast->kind != ZEND_AST_ZVAL) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "declare(%s) value must be a literal", ZSTR_VAL(name));
|
||||
}
|
||||
|
||||
if (zend_string_equals_literal_ci(name, "ticks")) {
|
||||
zval value_zv;
|
||||
zend_const_expr_to_zval(&value_zv, value_ast);
|
||||
|
||||
@@ -556,8 +556,8 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
|
||||
break;
|
||||
case IS_DOUBLE: {
|
||||
double dval = Z_DVAL_P(arg);
|
||||
char *s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
|
||||
int l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */
|
||||
char *s_tmp;
|
||||
size_t l_tmp = zend_spprintf(&s_tmp, MAX_LENGTH_OF_DOUBLE + EG(precision) + 1, "%.*G", (int) EG(precision), dval); /* SAFE */
|
||||
smart_str_appendl(str, s_tmp, l_tmp);
|
||||
smart_str_appends(str, ", ");
|
||||
efree(s_tmp);
|
||||
|
||||
@@ -79,6 +79,10 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
|
||||
return variable_ptr;
|
||||
}
|
||||
if (ZEND_CONST_COND(value_type & (IS_VAR|IS_CV), 1) && variable_ptr == value) {
|
||||
if (value_type == IS_VAR && ref) {
|
||||
ZEND_ASSERT(GC_REFCOUNT(ref) > 1);
|
||||
--GC_REFCOUNT(ref);
|
||||
}
|
||||
return variable_ptr;
|
||||
}
|
||||
garbage = Z_COUNTED_P(variable_ptr);
|
||||
|
||||
@@ -343,6 +343,10 @@ void shutdown_executor(void) /* {{{ */
|
||||
zend_llist_destroy(&CG(open_files));
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
clean_non_persistent_constants();
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
zend_close_rsrc_list(&EG(regular_list));
|
||||
} zend_end_try();
|
||||
@@ -374,10 +378,6 @@ void shutdown_executor(void) /* {{{ */
|
||||
}
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
clean_non_persistent_constants();
|
||||
} zend_end_try();
|
||||
|
||||
zend_try {
|
||||
#if 0&&ZEND_DEBUG
|
||||
signal(SIGSEGV, original_sigsegv_handler);
|
||||
|
||||
+74
-52
@@ -25,26 +25,12 @@
|
||||
/* one (0) is reserved */
|
||||
#define GC_ROOT_BUFFER_MAX_ENTRIES 10001
|
||||
|
||||
#define GC_FAKE_BUFFER_FLAG 0x80
|
||||
#define GC_TYPE_MASK 0x7f
|
||||
|
||||
#define GC_HAS_DESTRUCTORS (1<<0)
|
||||
|
||||
#ifndef ZEND_GC_DEBUG
|
||||
# define ZEND_GC_DEBUG 0
|
||||
#endif
|
||||
|
||||
#define GC_NUM_ADDITIONAL_ENTRIES \
|
||||
((4096 - ZEND_MM_OVERHEAD - sizeof(void*) * 2) / sizeof(gc_root_buffer))
|
||||
|
||||
typedef struct _gc_addtional_bufer gc_additional_buffer;
|
||||
|
||||
struct _gc_addtional_bufer {
|
||||
uint32_t used;
|
||||
gc_additional_buffer *next;
|
||||
gc_root_buffer buf[GC_NUM_ADDITIONAL_ENTRIES];
|
||||
};
|
||||
|
||||
#ifdef ZTS
|
||||
ZEND_API int gc_globals_id;
|
||||
#else
|
||||
@@ -53,9 +39,6 @@ ZEND_API zend_gc_globals gc_globals;
|
||||
|
||||
ZEND_API int (*gc_collect_cycles)(void);
|
||||
|
||||
#define GC_REMOVE_FROM_ROOTS(current) \
|
||||
gc_remove_from_roots((current))
|
||||
|
||||
#if ZEND_GC_DEBUG > 1
|
||||
# define GC_TRACE(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__);
|
||||
# define GC_TRACE_REF(ref, format, ...) \
|
||||
@@ -123,6 +106,12 @@ static zend_always_inline void gc_remove_from_roots(gc_root_buffer *root)
|
||||
GC_BENCH_DEC(root_buf_length);
|
||||
}
|
||||
|
||||
static zend_always_inline void gc_remove_from_additional_roots(gc_root_buffer *root)
|
||||
{
|
||||
root->next->prev = root->prev;
|
||||
root->prev->next = root->next;
|
||||
}
|
||||
|
||||
static void root_buffer_dtor(zend_gc_globals *gc_globals)
|
||||
{
|
||||
if (gc_globals->buf) {
|
||||
@@ -149,6 +138,8 @@ static void gc_globals_ctor_ex(zend_gc_globals *gc_globals)
|
||||
gc_globals->gc_runs = 0;
|
||||
gc_globals->collected = 0;
|
||||
|
||||
gc_globals->additional_buffer = NULL;
|
||||
|
||||
#if GC_BENCH
|
||||
gc_globals->root_buf_length = 0;
|
||||
gc_globals->root_buf_peak = 0;
|
||||
@@ -204,6 +195,8 @@ ZEND_API void gc_reset(void)
|
||||
GC_G(first_unused) = NULL;
|
||||
GC_G(last_unused) = NULL;
|
||||
}
|
||||
|
||||
GC_G(additional_buffer) = NULL;
|
||||
}
|
||||
|
||||
ZEND_API void gc_init(void)
|
||||
@@ -276,21 +269,45 @@ ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref)
|
||||
GC_BENCH_PEAK(root_buf_peak, root_buf_length);
|
||||
}
|
||||
|
||||
static zend_always_inline gc_root_buffer* gc_find_additional_buffer(zend_refcounted *ref)
|
||||
{
|
||||
gc_additional_buffer *additional_buffer = GC_G(additional_buffer);
|
||||
|
||||
/* We have to check each additional_buffer to find which one holds the ref */
|
||||
while (additional_buffer) {
|
||||
uint32_t idx = GC_ADDRESS(GC_INFO(ref)) - GC_ROOT_BUFFER_MAX_ENTRIES;
|
||||
if (idx < additional_buffer->used) {
|
||||
gc_root_buffer *root = additional_buffer->buf + idx;
|
||||
if (root->ref == ref) {
|
||||
return root;
|
||||
}
|
||||
}
|
||||
additional_buffer = additional_buffer->next;
|
||||
}
|
||||
|
||||
ZEND_ASSERT(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ZEND_API void ZEND_FASTCALL gc_remove_from_buffer(zend_refcounted *ref)
|
||||
{
|
||||
gc_root_buffer *root;
|
||||
|
||||
ZEND_ASSERT(GC_ADDRESS(GC_INFO(ref)));
|
||||
ZEND_ASSERT(GC_ADDRESS(GC_INFO(ref)) < GC_ROOT_BUFFER_MAX_ENTRIES);
|
||||
|
||||
GC_BENCH_INC(zval_remove_from_buffer);
|
||||
|
||||
root = GC_G(buf) + GC_ADDRESS(GC_INFO(ref));
|
||||
if (EXPECTED(GC_ADDRESS(GC_INFO(ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
|
||||
root = GC_G(buf) + GC_ADDRESS(GC_INFO(ref));
|
||||
gc_remove_from_roots(root);
|
||||
} else {
|
||||
root = gc_find_additional_buffer(ref);
|
||||
gc_remove_from_additional_roots(root);
|
||||
}
|
||||
if (GC_REF_GET_COLOR(ref) != GC_BLACK) {
|
||||
GC_TRACE_SET_COLOR(ref, GC_PURPLE);
|
||||
}
|
||||
GC_INFO(ref) = 0;
|
||||
GC_REMOVE_FROM_ROOTS(root);
|
||||
|
||||
/* updete next root that is going to be freed */
|
||||
if (GC_G(next_to_free) == root) {
|
||||
@@ -641,7 +658,7 @@ static void gc_scan_roots(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void gc_add_garbage(zend_refcounted *ref, gc_additional_buffer **additional_buffer)
|
||||
static void gc_add_garbage(zend_refcounted *ref)
|
||||
{
|
||||
gc_root_buffer *buf = GC_G(unused);
|
||||
|
||||
@@ -664,25 +681,23 @@ static void gc_add_garbage(zend_refcounted *ref, gc_additional_buffer **addition
|
||||
#endif
|
||||
} else {
|
||||
/* If we don't have free slots in the buffer, allocate a new one and
|
||||
* set it's address to GC_ROOT_BUFFER_MAX_ENTRIES that have special
|
||||
* set it's address above GC_ROOT_BUFFER_MAX_ENTRIES that have special
|
||||
* meaning.
|
||||
*/
|
||||
if (!*additional_buffer || (*additional_buffer)->used == GC_NUM_ADDITIONAL_ENTRIES) {
|
||||
if (!GC_G(additional_buffer) || GC_G(additional_buffer)->used == GC_NUM_ADDITIONAL_ENTRIES) {
|
||||
gc_additional_buffer *new_buffer = emalloc(sizeof(gc_additional_buffer));
|
||||
new_buffer->used = 0;
|
||||
new_buffer->next = *additional_buffer;
|
||||
*additional_buffer = new_buffer;
|
||||
new_buffer->next = GC_G(additional_buffer);
|
||||
GC_G(additional_buffer) = new_buffer;
|
||||
}
|
||||
buf = (*additional_buffer)->buf + (*additional_buffer)->used;
|
||||
(*additional_buffer)->used++;
|
||||
buf = GC_G(additional_buffer)->buf + GC_G(additional_buffer)->used;
|
||||
#if 1
|
||||
/* optimization: color is already GC_BLACK (0) */
|
||||
GC_INFO(ref) = GC_ROOT_BUFFER_MAX_ENTRIES;
|
||||
GC_INFO(ref) = GC_ROOT_BUFFER_MAX_ENTRIES + GC_G(additional_buffer)->used;
|
||||
#else
|
||||
GC_REF_SET_ADDRESS(ref, GC_ROOT_BUFFER_MAX_ENTRIES);
|
||||
GC_REF_SET_ADDRESS(ref, GC_ROOT_BUFFER_MAX_ENTRIES) + GC_G(additional_buffer)->used;
|
||||
#endif
|
||||
/* modify type to prevent indirect destruction */
|
||||
GC_TYPE(ref) |= GC_FAKE_BUFFER_FLAG;
|
||||
GC_G(additional_buffer)->used++;
|
||||
}
|
||||
if (buf) {
|
||||
GC_REFCOUNT(ref)++;
|
||||
@@ -694,7 +709,7 @@ static void gc_add_garbage(zend_refcounted *ref, gc_additional_buffer **addition
|
||||
}
|
||||
}
|
||||
|
||||
static int gc_collect_white(zend_refcounted *ref, uint32_t *flags, gc_additional_buffer **additional_buffer)
|
||||
static int gc_collect_white(zend_refcounted *ref, uint32_t *flags)
|
||||
{
|
||||
int count = 0;
|
||||
HashTable *ht;
|
||||
@@ -727,7 +742,7 @@ tail_call:
|
||||
#else
|
||||
if (!GC_ADDRESS(GC_INFO(ref))) {
|
||||
#endif
|
||||
gc_add_garbage(ref, additional_buffer);
|
||||
gc_add_garbage(ref);
|
||||
}
|
||||
if (obj->handlers->dtor_obj &&
|
||||
((obj->handlers->dtor_obj != zend_objects_destroy_object) ||
|
||||
@@ -751,7 +766,7 @@ tail_call:
|
||||
if (Z_REFCOUNTED_P(zv)) {
|
||||
ref = Z_COUNTED_P(zv);
|
||||
GC_REFCOUNT(ref)++;
|
||||
count += gc_collect_white(ref, flags, additional_buffer);
|
||||
count += gc_collect_white(ref, flags);
|
||||
/* count non-refcounted for compatibility ??? */
|
||||
} else if (Z_TYPE_P(zv) != IS_UNDEF) {
|
||||
count++;
|
||||
@@ -773,7 +788,7 @@ tail_call:
|
||||
#else
|
||||
if (!GC_ADDRESS(GC_INFO(ref))) {
|
||||
#endif
|
||||
gc_add_garbage(ref, additional_buffer);
|
||||
gc_add_garbage(ref);
|
||||
}
|
||||
ht = (zend_array*)ref;
|
||||
} else if (GC_TYPE(ref) == IS_REFERENCE) {
|
||||
@@ -813,7 +828,7 @@ tail_call:
|
||||
if (Z_REFCOUNTED_P(zv)) {
|
||||
ref = Z_COUNTED_P(zv);
|
||||
GC_REFCOUNT(ref)++;
|
||||
count += gc_collect_white(ref, flags, additional_buffer);
|
||||
count += gc_collect_white(ref, flags);
|
||||
/* count non-refcounted for compatibility ??? */
|
||||
} else if (Z_TYPE_P(zv) != IS_UNDEF) {
|
||||
count++;
|
||||
@@ -831,7 +846,7 @@ tail_call:
|
||||
return count;
|
||||
}
|
||||
|
||||
static int gc_collect_roots(uint32_t *flags, gc_additional_buffer **additional_buffer)
|
||||
static int gc_collect_roots(uint32_t *flags)
|
||||
{
|
||||
int count = 0;
|
||||
gc_root_buffer *current = GC_G(roots).next;
|
||||
@@ -840,8 +855,12 @@ static int gc_collect_roots(uint32_t *flags, gc_additional_buffer **additional_b
|
||||
while (current != &GC_G(roots)) {
|
||||
gc_root_buffer *next = current->next;
|
||||
if (GC_REF_GET_COLOR(current->ref) == GC_BLACK) {
|
||||
if (EXPECTED(GC_ADDRESS(GC_INFO(current->ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
|
||||
gc_remove_from_roots(current);
|
||||
} else {
|
||||
gc_remove_from_additional_roots(current);
|
||||
}
|
||||
GC_INFO(current->ref) = 0; /* reset GC_ADDRESS() and keep GC_BLACK */
|
||||
GC_REMOVE_FROM_ROOTS(current);
|
||||
}
|
||||
current = next;
|
||||
}
|
||||
@@ -850,7 +869,7 @@ static int gc_collect_roots(uint32_t *flags, gc_additional_buffer **additional_b
|
||||
while (current != &GC_G(roots)) {
|
||||
GC_REFCOUNT(current->ref)++;
|
||||
if (GC_REF_GET_COLOR(current->ref) == GC_WHITE) {
|
||||
count += gc_collect_white(current->ref, flags, additional_buffer);
|
||||
count += gc_collect_white(current->ref, flags);
|
||||
}
|
||||
current = current->next;
|
||||
}
|
||||
@@ -886,13 +905,16 @@ static void gc_remove_nested_data_from_buffer(zend_refcounted *ref, gc_root_buff
|
||||
tail_call:
|
||||
if (root ||
|
||||
(GC_ADDRESS(GC_INFO(ref)) != 0 &&
|
||||
GC_REF_GET_COLOR(ref) == GC_BLACK &&
|
||||
GC_ADDRESS(GC_INFO(ref)) != GC_ROOT_BUFFER_MAX_ENTRIES)) {
|
||||
GC_REF_GET_COLOR(ref) == GC_BLACK)) {
|
||||
GC_TRACE_REF(ref, "removing from buffer");
|
||||
GC_REFCOUNT(ref)--;
|
||||
if (root) {
|
||||
if (EXPECTED(GC_ADDRESS(GC_INFO(root->ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
|
||||
gc_remove_from_roots(root);
|
||||
} else {
|
||||
gc_remove_from_additional_roots(root);
|
||||
}
|
||||
GC_INFO(ref) = 0;
|
||||
GC_REMOVE_FROM_ROOTS(root);
|
||||
root = NULL;
|
||||
} else {
|
||||
GC_REMOVE_FROM_BUFFER(ref);
|
||||
@@ -986,7 +1008,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
zend_refcounted *p;
|
||||
gc_root_buffer to_free;
|
||||
uint32_t gc_flags = 0;
|
||||
gc_additional_buffer *additional_buffer;
|
||||
gc_additional_buffer *additional_buffer_snapshot;
|
||||
#if ZEND_GC_DEBUG
|
||||
zend_bool orig_gc_full;
|
||||
#endif
|
||||
@@ -1010,8 +1032,8 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
#endif
|
||||
|
||||
GC_TRACE("Collecting roots");
|
||||
additional_buffer = NULL;
|
||||
count = gc_collect_roots(&gc_flags, &additional_buffer);
|
||||
additional_buffer_snapshot = GC_G(additional_buffer);
|
||||
count = gc_collect_roots(&gc_flags);
|
||||
#if ZEND_GC_DEBUG
|
||||
GC_G(gc_full) = orig_gc_full;
|
||||
#endif
|
||||
@@ -1055,7 +1077,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
while (current != &to_free) {
|
||||
p = current->ref;
|
||||
GC_G(next_to_free) = current->next;
|
||||
if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_OBJECT) {
|
||||
if (GC_TYPE(p) == IS_OBJECT) {
|
||||
zend_object *obj = (zend_object*)p;
|
||||
|
||||
if (IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
|
||||
@@ -1092,7 +1114,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
p = current->ref;
|
||||
GC_G(next_to_free) = current->next;
|
||||
GC_TRACE_REF(p, "destroying");
|
||||
if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_OBJECT) {
|
||||
if (GC_TYPE(p) == IS_OBJECT) {
|
||||
zend_object *obj = (zend_object*)p;
|
||||
|
||||
if (EG(objects_store).object_buckets &&
|
||||
@@ -1111,7 +1133,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
EG(objects_store).free_list_head = obj->handle;
|
||||
p = current->ref = (zend_refcounted*)(((char*)obj) - obj->handlers->offset);
|
||||
}
|
||||
} else if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_ARRAY) {
|
||||
} else if (GC_TYPE(p) == IS_ARRAY) {
|
||||
zend_array *arr = (zend_array*)p;
|
||||
|
||||
GC_TYPE(arr) = IS_NULL;
|
||||
@@ -1133,10 +1155,10 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
current = next;
|
||||
}
|
||||
|
||||
while (additional_buffer != NULL) {
|
||||
gc_additional_buffer *next = additional_buffer->next;
|
||||
efree(additional_buffer);
|
||||
additional_buffer = next;
|
||||
while (GC_G(additional_buffer) != additional_buffer_snapshot) {
|
||||
gc_additional_buffer *next = GC_G(additional_buffer)->next;
|
||||
efree(GC_G(additional_buffer));
|
||||
GC_G(additional_buffer) = next;
|
||||
}
|
||||
|
||||
GC_TRACE("Collection finished");
|
||||
|
||||
@@ -67,6 +67,17 @@ typedef struct _gc_root_buffer {
|
||||
uint32_t refcount;
|
||||
} gc_root_buffer;
|
||||
|
||||
#define GC_NUM_ADDITIONAL_ENTRIES \
|
||||
((4096 - ZEND_MM_OVERHEAD - sizeof(void*) * 2) / sizeof(gc_root_buffer))
|
||||
|
||||
typedef struct _gc_additional_bufer gc_additional_buffer;
|
||||
|
||||
struct _gc_additional_bufer {
|
||||
uint32_t used;
|
||||
gc_additional_buffer *next;
|
||||
gc_root_buffer buf[GC_NUM_ADDITIONAL_ENTRIES];
|
||||
};
|
||||
|
||||
typedef struct _zend_gc_globals {
|
||||
zend_bool gc_enabled;
|
||||
zend_bool gc_active;
|
||||
@@ -93,6 +104,8 @@ typedef struct _zend_gc_globals {
|
||||
uint32_t zval_marked_grey;
|
||||
#endif
|
||||
|
||||
gc_additional_buffer *additional_buffer;
|
||||
|
||||
} zend_gc_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
@@ -310,6 +310,16 @@ static zend_always_inline int zend_hash_str_exists_ind(const HashTable *ht, cons
|
||||
Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF);
|
||||
}
|
||||
|
||||
static zend_always_inline zval *zend_symbtable_add_new(HashTable *ht, zend_string *key, zval *pData)
|
||||
{
|
||||
zend_ulong idx;
|
||||
|
||||
if (ZEND_HANDLE_NUMERIC(key, idx)) {
|
||||
return zend_hash_index_add_new(ht, idx, pData);
|
||||
} else {
|
||||
return zend_hash_add_new(ht, key, pData);
|
||||
}
|
||||
}
|
||||
|
||||
static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
|
||||
{
|
||||
|
||||
+472
-449
File diff suppressed because it is too large.
Load diff
@@ -1155,7 +1155,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
RETURN_TOKEN(T_RETURN);
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from" {
|
||||
<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from"[^a-zA-Z0-9_\x80-\xff] {
|
||||
yyless(yyleng - 1);
|
||||
HANDLE_NEWLINES(yytext, yyleng);
|
||||
RETURN_TOKEN(T_YIELD_FROM);
|
||||
}
|
||||
|
||||
+48
-19
@@ -926,8 +926,13 @@ ZEND_API int ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_ADD, add_function);
|
||||
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
op2 = op1;
|
||||
}
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Unsupported operand types");
|
||||
@@ -979,8 +984,13 @@ ZEND_API int ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SUB, sub_function);
|
||||
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
op2 = op1;
|
||||
}
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Unsupported operand types");
|
||||
@@ -1026,8 +1036,13 @@ ZEND_API int ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MUL, mul_function);
|
||||
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
op2 = op1;
|
||||
}
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Unsupported operand types");
|
||||
@@ -1104,17 +1119,27 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_POW, pow_function);
|
||||
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
}
|
||||
if (Z_TYPE_P(op2) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 1L);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
}
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
}
|
||||
if (Z_TYPE_P(op2) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 1L);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
}
|
||||
op2 = op1;
|
||||
}
|
||||
converted = 1;
|
||||
} else {
|
||||
@@ -1178,9 +1203,13 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {
|
||||
op2 = Z_REFVAL_P(op2);
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_DIV, div_function);
|
||||
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
op2 = op1;
|
||||
}
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Unsupported operand types");
|
||||
|
||||
+13
-5
@@ -131,6 +131,12 @@
|
||||
|
||||
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
|
||||
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(address_sanitizer)
|
||||
# define __SANITIZE_ADDRESS__
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef RTLD_LAZY
|
||||
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
|
||||
# endif
|
||||
@@ -141,7 +147,7 @@
|
||||
|
||||
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
|
||||
# elif defined(RTLD_DEEPBIND)
|
||||
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
|
||||
# else
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
|
||||
@@ -239,11 +245,13 @@ char *alloca();
|
||||
# define ZEND_FASTCALL
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
|
||||
#else
|
||||
# define __restrict__
|
||||
#ifndef restrict
|
||||
# if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
|
||||
# else
|
||||
# define __restrict__
|
||||
# endif
|
||||
# define restrict __restrict__
|
||||
#endif
|
||||
#define restrict __restrict__
|
||||
|
||||
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
|
||||
# define HAVE_NORETURN
|
||||
|
||||
+14
-2
@@ -74,12 +74,17 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
|
||||
{
|
||||
int errno_save = errno;
|
||||
zend_signal_queue_t *queue, *qtmp;
|
||||
zend_bool is_handling_safe = 1;
|
||||
|
||||
#ifdef ZTS
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
/* A signal could hit after TSRM shutdown, in this case globals are already freed. */
|
||||
if (NULL == TSRMLS_CACHE || NULL == TSRMG_BULK_STATIC(zend_signal_globals_id, zend_signal_globals_t *)) {
|
||||
is_handling_safe = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (EXPECTED(SIGG(active))) {
|
||||
if (EXPECTED(is_handling_safe && SIGG(active))) {
|
||||
if (UNEXPECTED(SIGG(depth) == 0)) { /* try to handle signal */
|
||||
if (UNEXPECTED(SIGG(blocked))) {
|
||||
SIGG(blocked) = 0;
|
||||
@@ -162,7 +167,14 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context)
|
||||
int errno_save = errno;
|
||||
struct sigaction sa = {{0}};
|
||||
sigset_t sigset;
|
||||
zend_signal_entry_t p_sig = SIGG(handlers)[signo-1];
|
||||
zend_signal_entry_t p_sig;
|
||||
#ifdef ZTS
|
||||
if (NULL == TSRMLS_CACHE || NULL == TSRMG_BULK_STATIC(zend_signal_globals_id, zend_signal_globals_t *)) {
|
||||
p_sig.flags = 0;
|
||||
p_sig.handler = SIG_DFL;
|
||||
} else
|
||||
#endif
|
||||
p_sig = SIGG(handlers)[signo-1];
|
||||
|
||||
if (p_sig.handler == SIG_DFL) { /* raise default handler */
|
||||
if (sigaction(signo, NULL, &sa) == 0) {
|
||||
|
||||
+4
-3
@@ -912,9 +912,10 @@ static zend_always_inline uint32_t zval_delref_p(zval* pz) {
|
||||
|
||||
#define SEPARATE_STRING(zv) do { \
|
||||
zval *_zv = (zv); \
|
||||
if (Z_REFCOUNTED_P(_zv) && \
|
||||
Z_REFCOUNT_P(_zv) > 1) { \
|
||||
Z_DELREF_P(_zv); \
|
||||
if (Z_REFCOUNT_P(_zv) > 1) { \
|
||||
if (Z_REFCOUNTED_P(_zv)) { \
|
||||
Z_DELREF_P(_zv); \
|
||||
} \
|
||||
zval_copy_ctor_func(_zv); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
+11
-3
@@ -1376,8 +1376,11 @@ main() {
|
||||
dir = opendir("/");
|
||||
if (!dir)
|
||||
exit(1);
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0)
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) {
|
||||
close(dir);
|
||||
exit(0);
|
||||
}
|
||||
close(dir);
|
||||
exit(1);
|
||||
}
|
||||
],[
|
||||
@@ -2334,13 +2337,15 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
|
||||
dnl If pkg-config is found try using it
|
||||
if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
|
||||
if $PKG_CONFIG --atleast-version=0.9.8 openssl; then
|
||||
if $PKG_CONFIG --atleast-version=1.1 openssl; then
|
||||
AC_MSG_ERROR([OpenSSL version >= 1.1 is not supported.])
|
||||
elif $PKG_CONFIG --atleast-version=0.9.8 openssl; then
|
||||
found_openssl=yes
|
||||
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
|
||||
OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
|
||||
OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
|
||||
else
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.8 or greater required.])
|
||||
AC_MSG_ERROR([OpenSSL version >= 0.9.8 and < 1.1 required.])
|
||||
fi
|
||||
|
||||
if test -n "$OPENSSL_LIBS"; then
|
||||
@@ -3109,3 +3114,6 @@ AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll])
|
||||
|
||||
])
|
||||
|
||||
dnl Load the AX_CHECK_COMPILE_FLAG macro from the autoconf archive.
|
||||
m4_include([build/ax_check_compile_flag.m4])
|
||||
@@ -12,14 +12,13 @@ if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
|
||||
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
|
||||
set STABILITY=stable
|
||||
) else (
|
||||
set BRANCH=master
|
||||
set STABILITY=staging
|
||||
)
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%APPVEYOR_REPO_BRANCH%
|
||||
set STABILITY=staging
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
|
||||
rem SDK is cached, deps info is cached as well
|
||||
echo Updating dependencies
|
||||
echo Updating dependencies in %DEPS_DIR%
|
||||
call phpsdk_deps --update --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
|
||||
@@ -4,7 +4,14 @@ set NO_INTERACTION=1
|
||||
set REPORT_EXIT_STATUS=1
|
||||
set SKIP_IO_CAPTURE_TESTS=1
|
||||
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%APPVEYOR_REPO_BRANCH%
|
||||
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
|
||||
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
|
||||
set STABILITY=stable
|
||||
) else (
|
||||
set BRANCH=master
|
||||
set STABILITY=staging
|
||||
)
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
|
||||
|
||||
rem setup MySQL related exts
|
||||
set MYSQL_PWD=Password12!
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given FLAG works with the current language's compiler
|
||||
# or gives an error. (Warnings, however, are ignored)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
# force the compiler to issue an error when a bad flag is given.
|
||||
#
|
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
#
|
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 4
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
AS_VAR_IF(CACHEVAR,yes,
|
||||
[m4_default([$2], :)],
|
||||
[m4_default([$3], :)])
|
||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
])dnl AX_CHECK_COMPILE_FLAGS
|
||||
+10
-10
@@ -69,33 +69,33 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
/* To enable the is_nan, is_infinite and is_finite PHP functions */
|
||||
#ifdef NETWARE
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#define HAVE_DECL_ISNAN 1
|
||||
#define HAVE_DECL_ISINF 1
|
||||
#define HAVE_DECL_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#ifdef HAVE_ISNAN
|
||||
#if HAVE_DECL_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#define zend_isnan(a) ((a) != (a))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#if HAVE_DECL_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=16
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=18
|
||||
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`
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
size_t fname_len, mime_len, postname_len;
|
||||
zval *cf = return_value;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ var_dump(curl_setopt_array($c, [
|
||||
CURLOPT_UPLOAD => true,
|
||||
CURLOPT_INFILE => $f,
|
||||
CURLOPT_INFILESIZE => filesize(__FILE__),
|
||||
CURLOPT_CONNECTTIMEOUT => 1,
|
||||
CURLOPT_TIMEOUT => 1,
|
||||
CURLOPT_CONNECTTIMEOUT => 3,
|
||||
CURLOPT_TIMEOUT => 3,
|
||||
]));
|
||||
fclose($f);
|
||||
var_dump(curl_setopt_array($c, [
|
||||
|
||||
@@ -40,7 +40,7 @@ SPNEGO => Yes
|
||||
SSL => Yes
|
||||
SSPI => Yes
|
||||
TLS-SRP => No
|
||||
HTTP2 => No
|
||||
HTTP2 => Yes
|
||||
GSSAPI => No
|
||||
KERBEROS5 => Yes
|
||||
UNIX_SOCKETS => No
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
array curl_multi_info_read ( resource $mh [, int &$msgs_in_queue = NULL ] );
|
||||
--CREDITS--
|
||||
marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("SKIP_ONLINE_TESTS")) { die('skip: online test'); }
|
||||
if (!extension_loaded('curl')) { print("skip"); }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$urls = array(
|
||||
"bugs.php.net",
|
||||
"pear.php.net"
|
||||
);
|
||||
|
||||
$mh = curl_multi_init();
|
||||
foreach ($urls as $i => $url) {
|
||||
$conn[$i] = curl_init($url);
|
||||
curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_multi_add_handle($mh, $conn[$i]);
|
||||
}
|
||||
|
||||
do {
|
||||
$status = curl_multi_exec($mh, $active);
|
||||
$info = curl_multi_info_read($mh);
|
||||
if (false !== $info) {
|
||||
var_dump(is_array($info));
|
||||
}
|
||||
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
|
||||
|
||||
foreach ($urls as $i => $url) {
|
||||
curl_close($conn[$i]);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -33,9 +33,9 @@ function curl_cli_server_start() {
|
||||
|
||||
// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
|
||||
// it might not be listening yet...need to wait until fsockopen() call returns
|
||||
$error = "Unable to connect to servers\n";
|
||||
$error = "Unable to connect to server\n";
|
||||
for ($i=0; $i < 60; $i++) {
|
||||
usleep(25000); // 25ms per try
|
||||
usleep(50000); // 50ms per try
|
||||
$status = proc_get_status($handle);
|
||||
$fp = @fsockopen(PHP_CURL_SERVER_HOSTNAME, PHP_CURL_SERVER_PORT);
|
||||
// Failure, the server is no longer running
|
||||
@@ -63,6 +63,14 @@ function curl_cli_server_start() {
|
||||
register_shutdown_function(
|
||||
function($handle) use($router) {
|
||||
proc_terminate($handle);
|
||||
/* Wait for server to shutdown */
|
||||
for ($i = 0; $i < 60; $i++) {
|
||||
$status = proc_get_status($handle);
|
||||
if (!($status && $status['running'])) {
|
||||
break;
|
||||
}
|
||||
usleep(50000);
|
||||
}
|
||||
},
|
||||
$handle
|
||||
);
|
||||
|
||||
+3673
-3600
File diff suppressed because it is too large.
Load diff
@@ -154,7 +154,7 @@ static void do_adjust_for_weekday(timelib_time* time)
|
||||
{
|
||||
/* To make "this week" work, where the current DOW is a "sunday" */
|
||||
if (current_dow == 0 && time->relative.weekday != 0) {
|
||||
time->relative.weekday = -6;
|
||||
time->relative.weekday -= 7;
|
||||
}
|
||||
|
||||
/* To make "sunday this week" work, where the current DOW is not a
|
||||
@@ -354,7 +354,7 @@ static timelib_sll do_years(timelib_sll year)
|
||||
return res;
|
||||
}
|
||||
|
||||
static timelib_sll do_months(timelib_ull month, timelib_ull year)
|
||||
static timelib_sll do_months(timelib_ull month, timelib_sll year)
|
||||
{
|
||||
if (timelib_is_leap(year)) {
|
||||
return ((month_tab_leap[month - 1] + 1) * SECS_PER_DAY);
|
||||
@@ -463,7 +463,7 @@ void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi)
|
||||
time->sse = res;
|
||||
|
||||
time->sse_uptodate = 1;
|
||||
time->have_relative = time->relative.have_weekday_relative = time->relative.have_special_relative = 0;
|
||||
time->have_relative = time->relative.have_weekday_relative = time->relative.have_special_relative = time->relative.first_last_day_of = 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -189,6 +189,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
|
||||
|
||||
timelib_unixtime2gmt(tm, ts - (tm->z * 60) + (tm->dst * 3600));
|
||||
|
||||
tm->sse = ts;
|
||||
tm->z = z;
|
||||
tm->dst = dst;
|
||||
break;
|
||||
|
||||
+10
-8
@@ -1141,11 +1141,12 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
|
||||
case 'A': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "PM" : "AM"); break;
|
||||
case 'B': {
|
||||
int retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
|
||||
while (retval < 0) {
|
||||
retval += 1000;
|
||||
int retval = ((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10);
|
||||
if (retval < 0) {
|
||||
retval += 864000;
|
||||
}
|
||||
retval = retval % 1000;
|
||||
/* Make sure to do this on a positive int to avoid rounding errors */
|
||||
retval = (retval / 864) % 1000;
|
||||
length = slprintf(buffer, 32, "%03d", retval);
|
||||
break;
|
||||
}
|
||||
@@ -1336,11 +1337,12 @@ PHPAPI int php_idate(char format, time_t ts, int localtime)
|
||||
|
||||
/* Swatch Beat a.k.a. Internet Time */
|
||||
case 'B':
|
||||
retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
|
||||
while (retval < 0) {
|
||||
retval += 1000;
|
||||
retval = ((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10);
|
||||
if (retval < 0) {
|
||||
retval += 864000;
|
||||
}
|
||||
retval = retval % 1000;
|
||||
/* Make sure to do this on a positive int to avoid rounding errors */
|
||||
retval = (retval / 864) % 1000;
|
||||
break;
|
||||
|
||||
/* time */
|
||||
|
||||
@@ -43,20 +43,20 @@ foreach ($tests as $test) {
|
||||
print "wanted = Monday 00:00:00\n\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Europe/Andorra
|
||||
ts = Monday 2037-10-19 17:17:17 CEST
|
||||
result = Monday 2037-10-26 00:00:00 CET
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Asia/Dubai
|
||||
ts = Thursday 1970-01-01 17:17:17 GST
|
||||
result = Monday 1970-01-05 00:00:00 GST
|
||||
ts = Thursday 1970-01-01 17:17:17 %s
|
||||
result = Monday 1970-01-05 00:00:00 %s
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Asia/Kabul
|
||||
ts = Thursday 1970-01-01 17:17:17 AFT
|
||||
result = Monday 1970-01-05 00:00:00 AFT
|
||||
ts = Thursday 1970-01-01 17:17:17 %s
|
||||
result = Monday 1970-01-05 00:00:00 %s
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
America/Antigua
|
||||
@@ -130,8 +130,8 @@ result = Monday 1971-01-04 00:00:00 AST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Asia/Dacca
|
||||
ts = Friday 1971-01-01 17:17:17 DACT
|
||||
result = Monday 1971-01-04 00:00:00 DACT
|
||||
ts = Friday 1971-01-01 17:17:17 %s
|
||||
result = Monday 1971-01-04 00:00:00 %s
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Europe/Brussels
|
||||
@@ -150,13 +150,13 @@ result = Monday 1983-04-18 01:00:00 CEST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
America/Buenos_Aires
|
||||
ts = Monday 1974-09-30 17:17:17 ART
|
||||
result = Monday 1974-10-07 00:00:00 ART
|
||||
ts = Monday 1974-09-30 17:17:17 %s
|
||||
result = Monday 1974-10-07 00:00:00 %s
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
America/Rosario
|
||||
ts = Monday 1974-09-30 17:17:17 ART
|
||||
result = Monday 1974-10-07 00:00:00 ART
|
||||
ts = Monday 1974-09-30 17:17:17 %s
|
||||
result = Monday 1974-10-07 00:00:00 %s
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Europe/Vienna
|
||||
|
||||
@@ -41,7 +41,7 @@ foreach ($timezones as $timezone) {
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
America/Chicago
|
||||
1076824799 [2004-02-14 23:59:59 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
|
||||
1076824800 [2004-02-15 00:00:00 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
|
||||
@@ -88,31 +88,31 @@ Asia/Jerusalem
|
||||
1083099600 [2004-04-28 00:00:00 IDT] [2004-04-07 00:00:00 +21 days]
|
||||
|
||||
Asia/Singapore
|
||||
1076774399 [2004-02-14 23:59:59 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
|
||||
1076774400 [2004-02-15 00:00:00 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
|
||||
1076774401 [2004-02-15 00:00:01 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
|
||||
1079452800 [2004-03-17 00:00:00 SGT] [2004-04-07 00:00:00 -21 days]
|
||||
1080316800 [2004-03-27 00:00:00 SGT] [2004-04-07 00:00:00 11 days ago]
|
||||
1080410400 [2004-03-28 02:00:00 SGT] [2004-04-07 00:00:00 -10 day +2 hours]
|
||||
1081180800 [2004-04-06 00:00:00 SGT] [2004-04-07 00:00:00 -1 day]
|
||||
1081267200 [2004-04-07 00:00:00 SGT] [2004-04-07 00:00:00]
|
||||
1081270800 [2004-04-07 01:00:00 SGT] [2004-04-07 00:00:00 +1 hour]
|
||||
1081274400 [2004-04-07 02:00:00 SGT] [2004-04-07 00:00:00 +2 hour]
|
||||
1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 +1 day]
|
||||
1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 1 day]
|
||||
1083081600 [2004-04-28 00:00:00 SGT] [2004-04-07 00:00:00 +21 days]
|
||||
1076774399 [2004-02-14 23:59:59 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
|
||||
1076774400 [2004-02-15 00:00:00 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
|
||||
1076774401 [2004-02-15 00:00:01 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
|
||||
1079452800 [2004-03-17 00:00:00 %s] [2004-04-07 00:00:00 -21 days]
|
||||
1080316800 [2004-03-27 00:00:00 %s] [2004-04-07 00:00:00 11 days ago]
|
||||
1080410400 [2004-03-28 02:00:00 %s] [2004-04-07 00:00:00 -10 day +2 hours]
|
||||
1081180800 [2004-04-06 00:00:00 %s] [2004-04-07 00:00:00 -1 day]
|
||||
1081267200 [2004-04-07 00:00:00 %s] [2004-04-07 00:00:00]
|
||||
1081270800 [2004-04-07 01:00:00 %s] [2004-04-07 00:00:00 +1 hour]
|
||||
1081274400 [2004-04-07 02:00:00 %s] [2004-04-07 00:00:00 +2 hour]
|
||||
1081353600 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 +1 day]
|
||||
1081353600 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 1 day]
|
||||
1083081600 [2004-04-28 00:00:00 %s] [2004-04-07 00:00:00 +21 days]
|
||||
|
||||
America/Sao_Paulo
|
||||
1076810399 [2004-02-14 23:59:59 BRST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
|
||||
1076814000 [2004-02-15 00:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
|
||||
1076814001 [2004-02-15 00:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
|
||||
1079492400 [2004-03-17 00:00:00 BRT] [2004-04-07 00:00:00 -21 days]
|
||||
1080356400 [2004-03-27 00:00:00 BRT] [2004-04-07 00:00:00 11 days ago]
|
||||
1080450000 [2004-03-28 02:00:00 BRT] [2004-04-07 00:00:00 -10 day +2 hours]
|
||||
1081220400 [2004-04-06 00:00:00 BRT] [2004-04-07 00:00:00 -1 day]
|
||||
1081306800 [2004-04-07 00:00:00 BRT] [2004-04-07 00:00:00]
|
||||
1081310400 [2004-04-07 01:00:00 BRT] [2004-04-07 00:00:00 +1 hour]
|
||||
1081314000 [2004-04-07 02:00:00 BRT] [2004-04-07 00:00:00 +2 hour]
|
||||
1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 +1 day]
|
||||
1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 1 day]
|
||||
1083121200 [2004-04-28 00:00:00 BRT] [2004-04-07 00:00:00 +21 days]
|
||||
1076810399 [2004-02-14 23:59:59 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
|
||||
1076814000 [2004-02-15 00:00:00 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
|
||||
1076814001 [2004-02-15 00:00:01 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
|
||||
1079492400 [2004-03-17 00:00:00 %s] [2004-04-07 00:00:00 -21 days]
|
||||
1080356400 [2004-03-27 00:00:00 %s] [2004-04-07 00:00:00 11 days ago]
|
||||
1080450000 [2004-03-28 02:00:00 %s] [2004-04-07 00:00:00 -10 day +2 hours]
|
||||
1081220400 [2004-04-06 00:00:00 %s] [2004-04-07 00:00:00 -1 day]
|
||||
1081306800 [2004-04-07 00:00:00 %s] [2004-04-07 00:00:00]
|
||||
1081310400 [2004-04-07 01:00:00 %s] [2004-04-07 00:00:00 +1 hour]
|
||||
1081314000 [2004-04-07 02:00:00 %s] [2004-04-07 00:00:00 +2 hour]
|
||||
1081393200 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 +1 day]
|
||||
1081393200 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 1 day]
|
||||
1083121200 [2004-04-28 00:00:00 %s] [2004-04-07 00:00:00 +21 days]
|
||||
@@ -34,18 +34,18 @@ echo date("Y-m-d H:i:s T\n", $l);
|
||||
1099364400
|
||||
1099364400
|
||||
1099447200
|
||||
2004-11-01 00:00:00 BRT
|
||||
2004-11-02 01:00:00 BRST
|
||||
2004-11-02 01:00:00 BRST
|
||||
2004-11-02 01:00:00 BRST
|
||||
2004-11-03 00:00:00 BRST
|
||||
2004-11-01 00:00:00 -03
|
||||
2004-11-02 01:00:00 -02
|
||||
2004-11-02 01:00:00 -02
|
||||
2004-11-02 01:00:00 -02
|
||||
2004-11-03 00:00:00 -02
|
||||
1108778400
|
||||
1108868400
|
||||
1108868400
|
||||
1108868400
|
||||
1108954800
|
||||
2005-02-19 00:00:00 BRST
|
||||
2005-02-20 00:00:00 BRT
|
||||
2005-02-20 00:00:00 BRT
|
||||
2005-02-20 00:00:00 BRT
|
||||
2005-02-21 00:00:00 BRT
|
||||
2005-02-19 00:00:00 -02
|
||||
2005-02-20 00:00:00 -03
|
||||
2005-02-20 00:00:00 -03
|
||||
2005-02-20 00:00:00 -03
|
||||
2005-02-21 00:00:00 -03
|
||||
@@ -200,23 +200,23 @@ print "wanted=Thursday 00:00:00\n\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
TZ=America/Mendoza - wrong day.
|
||||
tStamp=Sunday 1992-10-18 17:17:17 ARST 1
|
||||
result=Sunday 1992-10-25 00:00:00 ARST 1
|
||||
tStamp=Sunday 1992-10-18 17:17:17 -02 1
|
||||
result=Sunday 1992-10-25 00:00:00 -02 1
|
||||
wanted=Sunday 00:00:00
|
||||
|
||||
TZ=America/Catamarca - wrong day.
|
||||
tStamp=Sunday 1990-10-21 17:17:17 ARST 1
|
||||
result=Sunday 1990-10-28 00:00:00 ARST 1
|
||||
tStamp=Sunday 1990-10-21 17:17:17 -02 1
|
||||
result=Sunday 1990-10-28 00:00:00 -02 1
|
||||
wanted=Sunday 00:00:00
|
||||
|
||||
TZ=America/Cordoba - wrong day.
|
||||
tStamp=Sunday 1990-10-21 17:17:17 ARST 1
|
||||
result=Sunday 1990-10-28 00:00:00 ARST 1
|
||||
tStamp=Sunday 1990-10-21 17:17:17 -02 1
|
||||
result=Sunday 1990-10-28 00:00:00 -02 1
|
||||
wanted=Sunday 00:00:00
|
||||
|
||||
TZ=America/Rosario - wrong day.
|
||||
tStamp=Tuesday 1991-10-15 17:17:17 WART 0
|
||||
result=Tuesday 1991-10-22 00:00:00 ARST 1
|
||||
tStamp=Tuesday 1991-10-15 17:17:17 -04 0
|
||||
result=Tuesday 1991-10-22 00:00:00 -02 1
|
||||
wanted=Tuesday 00:00:00
|
||||
|
||||
TZ=Europe/Vienna - wrong day - giving unexpected results, at
|
||||
@@ -231,8 +231,8 @@ result=Monday 1992-09-28 00:00:00 +04 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=America/Noronha - wrong day.
|
||||
tStamp=Friday 1999-10-01 17:17:17 FNT 0
|
||||
result=Friday 1999-10-08 00:00:00 FNST 1
|
||||
tStamp=Friday 1999-10-01 17:17:17 -02 0
|
||||
result=Friday 1999-10-08 00:00:00 -01 1
|
||||
wanted=Friday 00:00:00
|
||||
|
||||
TZ=America/Havana - wrong day.
|
||||
@@ -256,13 +256,13 @@ result=Friday 2003-04-04 00:00:00 EEST 1
|
||||
wanted=Friday 00:00:00
|
||||
|
||||
TZ=Pacific/Kwajalein - wrong day.
|
||||
tStamp=Friday 1993-08-13 17:17:17 KWAT 0
|
||||
result=Saturday 1993-08-21 00:00:00 MHT 0
|
||||
tStamp=Friday 1993-08-13 17:17:17 -12 0
|
||||
result=Saturday 1993-08-21 00:00:00 +12 0
|
||||
wanted=Friday 00:00:00
|
||||
|
||||
TZ=Asia/Ulan_Bator - wrong day.
|
||||
tStamp=Saturday 2001-09-22 17:17:17 ULAST 1
|
||||
result=Saturday 2001-09-29 00:00:00 ULAST 1
|
||||
tStamp=Saturday 2001-09-22 17:17:17 +09 1
|
||||
result=Saturday 2001-09-29 00:00:00 +09 1
|
||||
wanted=Saturday 00:00:00
|
||||
|
||||
TZ=America/Cancun - wrong day.
|
||||
@@ -286,18 +286,18 @@ result=Thursday 2002-04-11 00:00:00 MDT 1
|
||||
wanted=Thursday 00:00:00
|
||||
|
||||
TZ=Asia/Kuala_Lumpur - wrong day.
|
||||
tStamp=Monday 1981-12-28 17:17:17 MALT 0
|
||||
result=Monday 1982-01-04 00:00:00 MYT 0
|
||||
tStamp=Monday 1981-12-28 17:17:17 +0730 0
|
||||
result=Monday 1982-01-04 00:00:00 +08 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=Pacific/Chatham - wrong day.
|
||||
tStamp=Monday 1974-10-28 17:17:17 CHAST 0
|
||||
result=Monday 1974-11-04 00:00:00 CHADT 1
|
||||
tStamp=Monday 1974-10-28 17:17:17 +1245 0
|
||||
result=Monday 1974-11-04 00:00:00 +1345 1
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=America/Lima - wrong day.
|
||||
tStamp=Thursday 1985-12-26 17:17:17 PET 0
|
||||
result=Thursday 1986-01-02 00:00:00 PEST 1
|
||||
tStamp=Thursday 1985-12-26 17:17:17 -05 0
|
||||
result=Thursday 1986-01-02 00:00:00 -04 1
|
||||
wanted=Thursday 00:00:00
|
||||
|
||||
TZ=Asia/Karachi - wrong day.
|
||||
@@ -306,16 +306,16 @@ result=Friday 2002-04-12 00:00:00 PKST 1
|
||||
wanted=Friday 00:00:00
|
||||
|
||||
TZ=America/Asuncion - wrong day.
|
||||
tStamp=Wednesday 2002-02-27 17:17:17 PYST 1
|
||||
result=Wednesday 2002-03-06 00:00:00 PYST 1
|
||||
tStamp=Wednesday 2002-02-27 17:17:17 -03 1
|
||||
result=Wednesday 2002-03-06 00:00:00 -03 1
|
||||
wanted=Wednesday 00:00:00
|
||||
|
||||
TZ=Asia/Singapore - wrong day.
|
||||
tStamp=Thursday 1981-12-31 17:17:17 SGT 0
|
||||
result=Thursday 1982-01-07 00:00:00 SGT 0
|
||||
tStamp=Thursday 1981-12-31 17:17:17 +0730 0
|
||||
result=Thursday 1982-01-07 00:00:00 +08 0
|
||||
wanted=Thursday 00:00:00
|
||||
|
||||
TZ=America/Montevideo - wrong day.
|
||||
tStamp=Thursday 2004-09-16 17:17:17 UYT 0
|
||||
result=Thursday 2004-09-23 00:00:00 UYST 1
|
||||
tStamp=Thursday 2004-09-16 17:17:17 -03 0
|
||||
result=Thursday 2004-09-23 00:00:00 -02 1
|
||||
wanted=Thursday 00:00:00
|
||||
@@ -76,13 +76,13 @@ print "wanted=Friday 00:00:00\n\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
TZ=Pacific/Rarotonga - wrong day.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 CKT 0
|
||||
result=Tuesday 1970-01-06 00:00:00 CKT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 -1030 0
|
||||
result=Tuesday 1970-01-06 00:00:00 -1030 0
|
||||
wanted=Tuesday 00:00:00
|
||||
|
||||
TZ=Atlantic/South_Georgia - wrong day.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 GST 0
|
||||
result=Tuesday 1970-01-06 00:00:00 GST 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 -02 0
|
||||
result=Tuesday 1970-01-06 00:00:00 -02 0
|
||||
wanted=Tuesday 00:00:00
|
||||
|
||||
TZ=America/Port-au-Prince - wrong day.
|
||||
@@ -91,13 +91,13 @@ result=Monday 2005-04-04 00:00:00 EDT 1
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=Pacific/Enderbury - wrong day, off by 2 days.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 PHOT 0
|
||||
result=Monday 1970-01-05 00:00:00 PHOT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 -12 0
|
||||
result=Monday 1970-01-05 00:00:00 -12 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=Pacific/Kiritimati - wrong day, off by 2 days.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 LINT 0
|
||||
result=Monday 1970-01-05 00:00:00 LINT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 -1040 0
|
||||
result=Monday 1970-01-05 00:00:00 -1040 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=America/Managua - wrong day.
|
||||
@@ -106,13 +106,13 @@ result=Tuesday 2005-04-12 00:00:00 CDT 1
|
||||
wanted=Tuesday 00:00:00
|
||||
|
||||
TZ=Pacific/Pitcairn - wrong day.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 PNT 0
|
||||
result=Wednesday 1970-01-07 00:00:00 PNT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 -0830 0
|
||||
result=Wednesday 1970-01-07 00:00:00 -0830 0
|
||||
wanted=Wednesday 00:00:00
|
||||
|
||||
TZ=Pacific/Fakaofo - wrong day.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 TKT 0
|
||||
result=Saturday 1970-01-03 00:00:00 TKT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 -11 0
|
||||
result=Saturday 1970-01-03 00:00:00 -11 0
|
||||
wanted=Saturday 00:00:00
|
||||
|
||||
TZ=Pacific/Johnston - wrong day.
|
||||
|
||||
@@ -23,8 +23,8 @@ print "wanted=Sunday 00:00:00\n\n";
|
||||
--EXPECT--
|
||||
TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1
|
||||
AM as per most DST transitions?
|
||||
tStamp=Monday 1990-10-15 17:17:17 WART 0
|
||||
result=Monday 1990-10-22 00:00:00 WART 0
|
||||
tStamp=Monday 1990-10-15 17:17:17 -04 0
|
||||
result=Monday 1990-10-22 00:00:00 -04 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?
|
||||
|
||||
@@ -116,11 +116,11 @@ print "wanted=Monday 00:00:00\n\n";
|
||||
|
||||
print "TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n";
|
||||
date_default_timezone_set('Africa/Monrovia');
|
||||
$tStamp = mktime (17, 17, 17, 1, 845, 1970);
|
||||
$tStamp = mktime (17, 17, 17, 1, 730, 1970);
|
||||
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
|
||||
$strtotime_tstamp = strtotime("next Monday", $tStamp);
|
||||
$strtotime_tstamp = strtotime("next Friday", $tStamp);
|
||||
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
|
||||
print "wanted=Monday 00:44:30\n\n";
|
||||
print "wanted=Friday 00:44:30\n\n";
|
||||
|
||||
print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n";
|
||||
date_default_timezone_set('Asia/Katmandu');
|
||||
@@ -208,7 +208,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
|
||||
print "wanted=Monday 00:30:00\n\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
|
||||
have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 CAT 0
|
||||
@@ -216,14 +216,14 @@ result=Wednesday 1970-01-07 00:00:00 CAT 0
|
||||
wanted=Wednesday 00:00:00
|
||||
|
||||
TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes
|
||||
tStamp=Thursday 1987-09-24 17:17:17 IST 0
|
||||
result=Thursday 1987-10-01 00:30:00 BTT 0
|
||||
tStamp=Thursday 1987-09-24 17:17:17 +0530 0
|
||||
result=Thursday 1987-10-01 00:30:00 +06 0
|
||||
wanted=Thursday 00:30:00
|
||||
|
||||
TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
|
||||
appear to have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 CCT 0
|
||||
result=Thursday 1970-01-08 00:00:00 CCT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +0630 0
|
||||
result=Thursday 1970-01-08 00:00:00 +0630 0
|
||||
wanted=Thursday 00:00:00
|
||||
|
||||
TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
|
||||
@@ -233,110 +233,110 @@ result=Saturday 1970-01-03 00:00:00 CAT 0
|
||||
wanted=Saturday 00:00:00
|
||||
|
||||
TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes
|
||||
tStamp=Thursday 1980-04-24 17:17:17 XJT 0
|
||||
result=Thursday 1980-05-01 00:00:00 XJT 0
|
||||
tStamp=Thursday 1980-04-24 17:17:17 +06 0
|
||||
result=Thursday 1980-05-01 00:00:00 +06 0
|
||||
wanted=Thursday 03:00:00
|
||||
|
||||
TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
|
||||
not appear to have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 CXT 0
|
||||
result=Sunday 1970-01-04 00:00:00 CXT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +07 0
|
||||
result=Sunday 1970-01-04 00:00:00 +07 0
|
||||
wanted=Sunday 00:00:00
|
||||
|
||||
TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes
|
||||
tStamp=Sunday 1970-10-18 17:17:17 EST 0
|
||||
result=Sunday 1970-10-25 00:30:00 EHDT 1
|
||||
result=Sunday 1970-10-25 00:30:00 -0430 1
|
||||
wanted=Sunday 00:30:00
|
||||
|
||||
TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not
|
||||
appear to have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 CHUT 0
|
||||
result=Tuesday 1970-01-06 00:00:00 CHUT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +10 0
|
||||
result=Tuesday 1970-01-06 00:00:00 +10 0
|
||||
wanted=Tuesday 00:00:00
|
||||
|
||||
TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does
|
||||
not appear to have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 PONT 0
|
||||
result=Monday 1970-01-05 00:00:00 PONT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +11 0
|
||||
result=Monday 1970-01-05 00:00:00 +11 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes
|
||||
tStamp=Sunday 1981-03-22 17:17:17 CGT 0
|
||||
result=Sunday 1981-03-29 02:00:00 EGST 1
|
||||
tStamp=Sunday 1981-03-22 17:17:17 -02 0
|
||||
result=Sunday 1981-03-29 02:00:00 +00 1
|
||||
wanted=Sunday 02:00:00
|
||||
|
||||
TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes
|
||||
tStamp=Thursday 1975-07-24 17:17:17 GYT 0
|
||||
result=Thursday 1975-07-31 00:45:00 GYT 0
|
||||
tStamp=Thursday 1975-07-24 17:17:17 -0345 0
|
||||
result=Thursday 1975-07-31 00:45:00 -03 0
|
||||
wanted=Thursday 00:45:00
|
||||
|
||||
TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes
|
||||
tStamp=Tuesday 1977-10-25 17:17:17 IRST 0
|
||||
result=Tuesday 1977-11-01 00:30:00 IRST 0
|
||||
tStamp=Tuesday 1977-10-25 17:17:17 +0330 0
|
||||
result=Tuesday 1977-11-01 00:30:00 +04 0
|
||||
wanted=Tuesday 00:30:00
|
||||
|
||||
TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
|
||||
not appear to have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 GILT 0
|
||||
result=Monday 1970-01-05 00:00:00 GILT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +12 0
|
||||
result=Monday 1970-01-05 00:00:00 +12 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes
|
||||
tStamp=Monday 1972-04-24 17:17:17 LRT 0
|
||||
result=Monday 1972-05-01 00:44:30 GMT 0
|
||||
wanted=Monday 00:44:30
|
||||
tStamp=Friday 1971-12-31 17:17:17 MMT 0
|
||||
result=Friday 1972-01-07 00:44:30 GMT 0
|
||||
wanted=Friday 00:44:30
|
||||
|
||||
TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes
|
||||
tStamp=Wednesday 1985-12-25 17:17:17 IST 0
|
||||
result=Wednesday 1986-01-01 00:15:00 NPT 0
|
||||
tStamp=Wednesday 1985-12-25 17:17:17 +0530 0
|
||||
result=Wednesday 1986-01-01 00:15:00 +0545 0
|
||||
wanted=Wednesday 00:15:00
|
||||
|
||||
TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes
|
||||
tStamp=Tuesday 1979-04-24 17:17:17 NRT 0
|
||||
result=Tuesday 1979-05-01 00:30:00 NRT 0
|
||||
tStamp=Tuesday 1979-04-24 17:17:17 +1130 0
|
||||
result=Tuesday 1979-05-01 00:30:00 +12 0
|
||||
wanted=Tuesday 00:30:00
|
||||
|
||||
TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes
|
||||
tStamp=Sunday 1978-09-24 17:17:17 NUT 0
|
||||
result=Sunday 1978-10-01 00:30:00 NUT 0
|
||||
tStamp=Sunday 1978-09-24 17:17:17 -1130 0
|
||||
result=Sunday 1978-10-01 00:30:00 -11 0
|
||||
wanted=Sunday 00:30:00
|
||||
|
||||
TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
|
||||
or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 PGT 0
|
||||
result=Thursday 1970-01-08 00:00:00 PGT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +10 0
|
||||
result=Thursday 1970-01-08 00:00:00 +10 0
|
||||
wanted=Thursday 00:00:00
|
||||
|
||||
TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes
|
||||
tStamp=Thursday 1980-04-24 17:17:17 AST 0
|
||||
result=Thursday 1980-05-01 01:00:00 PMST 0
|
||||
result=Thursday 1980-05-01 01:00:00 -03 0
|
||||
wanted=Thursday 01:00:00
|
||||
|
||||
TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
|
||||
timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 PWT 0
|
||||
result=Saturday 1970-01-03 00:00:00 PWT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +09 0
|
||||
result=Saturday 1970-01-03 00:00:00 +09 0
|
||||
wanted=Saturday 00:00:00
|
||||
|
||||
TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does
|
||||
not appear to have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 TVT 0
|
||||
result=Wednesday 1970-01-07 00:00:00 TVT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +12 0
|
||||
result=Wednesday 1970-01-07 00:00:00 +12 0
|
||||
wanted=Wednesday 00:00:00
|
||||
|
||||
TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not
|
||||
appear to have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 WAKT 0
|
||||
result=Tuesday 1970-01-06 00:00:00 WAKT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +12 0
|
||||
result=Tuesday 1970-01-06 00:00:00 +12 0
|
||||
wanted=Tuesday 00:00:00
|
||||
|
||||
TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does
|
||||
not appear to have a DST or timezone transition.
|
||||
tStamp=Thursday 1970-01-01 17:17:17 WFT 0
|
||||
result=Tuesday 1970-01-06 00:00:00 WFT 0
|
||||
tStamp=Thursday 1970-01-01 17:17:17 +12 0
|
||||
result=Tuesday 1970-01-06 00:00:00 +12 0
|
||||
wanted=Tuesday 00:00:00
|
||||
|
||||
TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes
|
||||
tStamp=Monday 1984-09-24 17:17:17 SRT 0
|
||||
result=Monday 1984-10-01 00:30:00 SRT 0
|
||||
tStamp=Monday 1984-09-24 17:17:17 -0330 0
|
||||
result=Monday 1984-10-01 00:30:00 -03 0
|
||||
wanted=Monday 00:30:00
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #72096: Swatch time value incorrect for dates before 1970
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
for ($unix = 1461283200; $unix <= 1461369600; $unix += 8000) {
|
||||
echo "Time:", gmdate('Y-m-d H:i:s = B', $unix), PHP_EOL;
|
||||
echo "Time:", gmdate('Y-m-d H:i:s = B', $unix - 82 * 365 * 24 * 3600), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Time:2016-04-22 00:00:00 = 041
|
||||
Time:1934-05-13 00:00:00 = 041
|
||||
Time:2016-04-22 02:13:20 = 134
|
||||
Time:1934-05-13 02:13:20 = 134
|
||||
Time:2016-04-22 04:26:40 = 226
|
||||
Time:1934-05-13 04:26:40 = 226
|
||||
Time:2016-04-22 06:40:00 = 319
|
||||
Time:1934-05-13 06:40:00 = 319
|
||||
Time:2016-04-22 08:53:20 = 412
|
||||
Time:1934-05-13 08:53:20 = 412
|
||||
Time:2016-04-22 11:06:40 = 504
|
||||
Time:1934-05-13 11:06:40 = 504
|
||||
Time:2016-04-22 13:20:00 = 597
|
||||
Time:1934-05-13 13:20:00 = 597
|
||||
Time:2016-04-22 15:33:20 = 689
|
||||
Time:1934-05-13 15:33:20 = 689
|
||||
Time:2016-04-22 17:46:40 = 782
|
||||
Time:1934-05-13 17:46:40 = 782
|
||||
Time:2016-04-22 20:00:00 = 875
|
||||
Time:1934-05-13 20:00:00 = 875
|
||||
Time:2016-04-22 22:13:20 = 967
|
||||
Time:1934-05-13 22:13:20 = 967
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #72719: Relative datetime format ignores weekday on sundays only
|
||||
--FILE--
|
||||
<?php
|
||||
echo (new DateTimeImmutable('Monday next week 13:00'))->format('l'), "\n";
|
||||
echo (new DateTimeImmutable('Tuesday next week 14:00'))->format('l'), "\n";
|
||||
echo (new DateTimeImmutable('Wednesday next week 14:00'))->format('l'), "\n";
|
||||
echo (new DateTimeImmutable('Thursday next week 15:00'))->format('l'), "\n";
|
||||
echo (new DateTimeImmutable('Friday next week 16:00'))->format('l'), "\n";
|
||||
echo (new DateTimeImmutable('Saturday next week 17:00'))->format('l'), "\n";
|
||||
echo (new DateTimeImmutable('Sunday next week 18:00'))->format('l'), "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Monday
|
||||
Tuesday
|
||||
Wednesday
|
||||
Thursday
|
||||
Friday
|
||||
Saturday
|
||||
Sunday
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #73294: DateTime wrong when date string is negative
|
||||
--FILE--
|
||||
<?php
|
||||
for ( $i = -1050; $i <= -1000; $i++ )
|
||||
{
|
||||
$M = "06";
|
||||
$D = "22";
|
||||
|
||||
$dt = new DateTime("{$i}-{$M}-{$D} 00:00:00");
|
||||
$expected = "{$i}-{$M}-{$D} 00:00:00";
|
||||
$result = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
if ( $expected != $result )
|
||||
{
|
||||
echo "Wrong: Should have been {$expected}, was {$result}\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
==DONE==
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #73489: wrong timestamp when call setTimeZone multi times with UTC offset
|
||||
--FILE--
|
||||
<?php
|
||||
// example 1 - Timestamp is changing
|
||||
$datetime = new DateTime('2016-11-09 20:00:00', new DateTimeZone('UTC'));
|
||||
var_dump($datetime->getTimestamp());
|
||||
$datetime->setTimeZone(new DateTimeZone('-03:00'));
|
||||
$datetime->setTimeZone(new DateTimeZone('-03:00'));
|
||||
var_dump($datetime->getTimestamp());
|
||||
|
||||
// example 2 - Timestamp keeps if you use getTimestamp() before second setTimeZone() calls
|
||||
$datetime = new DateTime('2016-11-09 20:00:00', new DateTimeZone('UTC'));
|
||||
var_dump($datetime->getTimestamp());
|
||||
$datetime->setTimeZone(new DateTimeZone('-03:00'));
|
||||
$datetime->getTimestamp();
|
||||
$datetime->setTimeZone(new DateTimeZone('-03:00'));
|
||||
var_dump($datetime->getTimestamp());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1478721600)
|
||||
int(1478721600)
|
||||
int(1478721600)
|
||||
int(1478721600)
|
||||
@@ -0,0 +1,63 @@
|
||||
--TEST--
|
||||
Bug #73858: diff() of two relative/described DateTimes is wrong
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
In the "verbose setup method" I'm trying setup the DateTime object myself
|
||||
to see if it's the format string which is parsed in correctly or if it's the DateTime
|
||||
object which is breaking stuff. From the testing it appears DateTime is broken somehow.
|
||||
*/
|
||||
$ss = 'february first day of last month midnight';
|
||||
$es = 'february first day of this month midnight - 1 second';
|
||||
|
||||
$s = new DateTime($ss);
|
||||
$e = new DateTime($es);
|
||||
$d= $e->diff($s);
|
||||
var_dump($d->days); // 0 ... but should be 30
|
||||
|
||||
$s = (new DateTime(null))->setTimestamp(strtotime($ss)); // verbose setup method
|
||||
$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method
|
||||
$d = $e->diff($s);
|
||||
var_dump($d->days); // 30 ... and should be 30
|
||||
|
||||
/*
|
||||
Next we will try mix/match the code to see what happens, surprisingly it seems that the end date ($e)
|
||||
is the important one, if it uses the verbose method it returns the correct values.
|
||||
*/
|
||||
$s = (new DateTime(null))->setTimestamp(strtotime($ss)); // verbose setup method
|
||||
$e = new DateTime($es);
|
||||
$d= $e->diff($s);
|
||||
var_dump($d->days); // 0 ... but should be 30
|
||||
|
||||
$s = new DateTime($ss);
|
||||
$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method
|
||||
$d= $e->diff($s);
|
||||
var_dump($d->days); // 30 ... and should be 30
|
||||
|
||||
/*
|
||||
This test just proves that the $e date is important BUT NOT because it's the one we call the diff() method
|
||||
on, that's just coincidental that seems to imply that the "- 1 second" in the date string is the problem.
|
||||
*/
|
||||
$s = new DateTime($ss);
|
||||
$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method
|
||||
$d= $s->diff($e);
|
||||
var_dump($d->days); // 30 ... and should be 30
|
||||
|
||||
/*
|
||||
[Workaround]
|
||||
This final test seems to prove that the input string is important and that the "- 1 secord" has a negative knock-on
|
||||
effect on the results of the diff. By modifying the datetime with ->modify everything works as expected ...
|
||||
it just means you have to be careful of how we work with DateTimes .
|
||||
*/
|
||||
$s = new DateTime($ss);
|
||||
$e = new DateTime('february first day of this month midnight');
|
||||
$e->modify('- 1 second');
|
||||
var_dump($e->diff($s)->days); // 30 ... and should be 30
|
||||
?>
|
||||
--EXPECT--
|
||||
int(30)
|
||||
int(30)
|
||||
int(30)
|
||||
int(30)
|
||||
int(30)
|
||||
int(30)
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #73942: $date->modify('Friday this week') doesn't return a Friday if $date is a Sunday
|
||||
--FILE--
|
||||
<?php
|
||||
$date1 = "2017-01-08"; // this is a Sunday
|
||||
$date = new \DateTime($date1);
|
||||
$date->modify('Friday this week');
|
||||
$dateFormat = $date->format('Y-m-d');
|
||||
echo $dateFormat, "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
2017-01-06
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #74057: wrong day when using "this week" in strtotime
|
||||
--FILE--
|
||||
<?php
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sun 2017-01-01")))."\n";
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Mon 2017-01-02")))."\n";
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Tue 2017-01-03")))."\n";
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Wed 2017-01-04")))."\n";
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Thu 2017-01-05")))."\n";
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Fri 2017-01-06")))."\n";
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sat 2017-01-07")))."\n";
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sun 2017-01-08")))."\n";
|
||||
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Mon 2017-01-09")))."\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Sat 2016-12-31
|
||||
Sat 2017-01-07
|
||||
Sat 2017-01-07
|
||||
Sat 2017-01-07
|
||||
Sat 2017-01-07
|
||||
Sat 2017-01-07
|
||||
Sat 2017-01-07
|
||||
Sat 2017-01-07
|
||||
Sat 2017-01-14
|
||||
@@ -22,8 +22,8 @@ $ts->modify("+ 1 hour 1 second");
|
||||
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Thu, 19 Aug 1993 23:59:59 KWAT
|
||||
Sat, 21 Aug 1993 00:00:00 MHT
|
||||
Thu, 19 Aug 1993 23:59:59 -12
|
||||
Sat, 21 Aug 1993 00:00:00 +12
|
||||
Sun, 27 Mar 2005 01:59:59 CET
|
||||
Sun, 27 Mar 2005 03:00:00 CEST
|
||||
Sun, 30 Oct 2005 01:59:59 CEST
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Test invalid time zone passed to ini_set
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
ini_set("date.timezone", "Incorrect/Zone");
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ini_set(): Invalid date.timezone value 'Incorrect/Zone', we selected the timezone 'UTC' for now. in %sini_set_incorrect.php on line %d
|
||||
+1
-1
@@ -213,7 +213,7 @@ Since: DOM Level 3
|
||||
*/
|
||||
int dom_attr_schema_type_info_read(dom_object *obj, zval *retval)
|
||||
{
|
||||
php_error_docref(NULL, E_WARNING, "Not yet implemented");
|
||||
/* TODO */
|
||||
ZVAL_NULL(retval);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+4
-4
@@ -2038,16 +2038,16 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (options) {
|
||||
htmlCtxtUseOptions(ctxt, (int)options);
|
||||
}
|
||||
|
||||
|
||||
ctxt->vctxt.error = php_libxml_ctx_error;
|
||||
ctxt->vctxt.warning = php_libxml_ctx_warning;
|
||||
if (ctxt->sax != NULL) {
|
||||
ctxt->sax->error = php_libxml_ctx_error;
|
||||
ctxt->sax->warning = php_libxml_ctx_warning;
|
||||
}
|
||||
if (options) {
|
||||
htmlCtxtUseOptions(ctxt, (int)options);
|
||||
}
|
||||
htmlParseDocument(ctxt);
|
||||
newdoc = ctxt->myDoc;
|
||||
htmlFreeParserCtxt(ctxt);
|
||||
|
||||
+28
-4
@@ -921,7 +921,7 @@ Since: DOM Level 2
|
||||
PHP_FUNCTION(dom_element_get_attribute_node_ns)
|
||||
{
|
||||
zval *id;
|
||||
xmlNodePtr elemp;
|
||||
xmlNodePtr elemp, fakeAttrp;
|
||||
xmlAttrPtr attrp;
|
||||
dom_object *intern;
|
||||
size_t uri_len, name_len;
|
||||
@@ -937,10 +937,34 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
|
||||
attrp = xmlHasNsProp(elemp, (xmlChar *)name, (xmlChar *)uri);
|
||||
|
||||
if (attrp == NULL) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
if (xmlStrEqual((xmlChar *) uri, (xmlChar *)DOM_XMLNS_NAMESPACE)) {
|
||||
xmlNsPtr nsptr;
|
||||
nsptr = dom_get_nsdecl(elemp, (xmlChar *)name);
|
||||
if (nsptr != NULL) {
|
||||
xmlNsPtr curns;
|
||||
curns = xmlNewNs(NULL, nsptr->href, NULL);
|
||||
if (nsptr->prefix) {
|
||||
curns->prefix = xmlStrdup((xmlChar *) nsptr->prefix);
|
||||
}
|
||||
if (nsptr->prefix) {
|
||||
fakeAttrp = xmlNewDocNode(elemp->doc, NULL, (xmlChar *) nsptr->prefix, nsptr->href);
|
||||
} else {
|
||||
fakeAttrp = xmlNewDocNode(elemp->doc, NULL, (xmlChar *)"xmlns", nsptr->href);
|
||||
}
|
||||
fakeAttrp->type = XML_NAMESPACE_DECL;
|
||||
fakeAttrp->parent = elemp;
|
||||
fakeAttrp->ns = curns;
|
||||
|
||||
DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern);
|
||||
DOM_RET_OBJ(fakeAttrp, &ret, intern);
|
||||
} else {
|
||||
RETURN_NULL();
|
||||
}
|
||||
} else {
|
||||
RETURN_NULL();
|
||||
}
|
||||
} else {
|
||||
DOM_RET_OBJ((xmlNodePtr) attrp, &ret, intern);
|
||||
}
|
||||
|
||||
}
|
||||
/* }}} end dom_element_get_attribute_node_ns */
|
||||
|
||||
+2
-1
@@ -549,7 +549,8 @@ int dom_node_next_sibling_read(dom_object *obj, zval *retval)
|
||||
|
||||
nextsib = nodep->next;
|
||||
if (!nextsib) {
|
||||
return FAILURE;
|
||||
ZVAL_NULL(retval);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
php_dom_create_object(nextsib, retval, obj);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #54382 DOMNode::getAttributeNodeNS doesn't get xmlns* attributes
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xmlString = '<?xml version="1.0" encoding="utf-8" ?>
|
||||
<root xmlns="http://ns" xmlns:ns2="http://ns2">
|
||||
<ns2:child />
|
||||
</root>';
|
||||
|
||||
$xml=new DOMDocument();
|
||||
$xml->loadXML($xmlString);
|
||||
$de = $xml->documentElement;
|
||||
|
||||
$ns2 = $de->getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "ns2");
|
||||
if ($ns2 == NULL) {
|
||||
echo 'namespace node does not exist.' . "\n";
|
||||
} else {
|
||||
echo 'namespace node prefix=' . $ns2->prefix . "\n";
|
||||
echo 'namespace node namespaceURI=' . $ns2->namespaceURI . "\n";
|
||||
}
|
||||
--EXPECT--
|
||||
namespace node prefix=ns2
|
||||
namespace node namespaceURI=http://ns2
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #61858 DOMAttr debug info generates E_WARNING
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML('<example a="b">Test</example>');
|
||||
|
||||
$example = $doc->getElementsByTagName('example')->item(0);
|
||||
$attr = $example->getAttributeNode('a');
|
||||
|
||||
var_dump($attr);
|
||||
print_r($attr);
|
||||
--EXPECTF--
|
||||
object(DOMAttr)#%d (%d) {
|
||||
%A
|
||||
}
|
||||
DOMAttr Object
|
||||
(
|
||||
%A
|
||||
)
|
||||
@@ -31,7 +31,7 @@ foreach ($dataNodes AS $node) {
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
int(3)
|
||||
object(DOMText)#%d (18) {
|
||||
object(DOMText)#%d (19) {
|
||||
["wholeText"]=>
|
||||
string(3) "
|
||||
"
|
||||
@@ -57,6 +57,8 @@ object(DOMText)#%d (18) {
|
||||
NULL
|
||||
["previousSibling"]=>
|
||||
NULL
|
||||
["nextSibling"]=>
|
||||
NULL
|
||||
["attributes"]=>
|
||||
NULL
|
||||
["ownerDocument"]=>
|
||||
@@ -73,7 +75,7 @@ object(DOMText)#%d (18) {
|
||||
string(3) "
|
||||
"
|
||||
}
|
||||
object(DOMElement)#%d (17) {
|
||||
object(DOMElement)#%d (18) {
|
||||
["tagName"]=>
|
||||
string(5) "form1"
|
||||
["schemaTypeInfo"]=>
|
||||
@@ -98,6 +100,8 @@ object(DOMElement)#%d (17) {
|
||||
string(22) "(object value omitted)"
|
||||
["previousSibling"]=>
|
||||
NULL
|
||||
["nextSibling"]=>
|
||||
NULL
|
||||
["attributes"]=>
|
||||
string(22) "(object value omitted)"
|
||||
["ownerDocument"]=>
|
||||
@@ -117,7 +121,7 @@ object(DOMElement)#%d (17) {
|
||||
Value C
|
||||
"
|
||||
}
|
||||
object(DOMText)#%d (18) {
|
||||
object(DOMText)#%d (19) {
|
||||
["wholeText"]=>
|
||||
string(1) "
|
||||
"
|
||||
@@ -143,6 +147,8 @@ object(DOMText)#%d (18) {
|
||||
NULL
|
||||
["previousSibling"]=>
|
||||
NULL
|
||||
["nextSibling"]=>
|
||||
NULL
|
||||
["attributes"]=>
|
||||
NULL
|
||||
["ownerDocument"]=>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #73907 nextSibling property not included in var_dump of DOMNode
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xmlString = '<?xml version="1.0" encoding="utf-8" ?>
|
||||
<root>
|
||||
</root>';
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML($xmlString);
|
||||
$attr = $doc->documentElement;
|
||||
|
||||
var_dump($attr);
|
||||
--EXPECTF--
|
||||
object(DOMElement)#%d (%d) {%A
|
||||
["nextSibling"]=>
|
||||
NULL
|
||||
%A}
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #74004 (DOMDocument->loadHTML and ->loadHTMLFile do not heed LIBXML_NOWARNING and LIBXML_NOERROR options)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$doc=new DOMDocument();
|
||||
$doc->loadHTML("<tag-throw></tag-throw>",LIBXML_NOERROR);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -2,8 +2,6 @@
|
||||
Test: setAttributeNode()
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--INI--
|
||||
error_reporting = E_ALL & ~E_WARNING
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ DOMDocument Object
|
||||
[firstChild] => (object value omitted)
|
||||
[lastChild] => (object value omitted)
|
||||
[previousSibling] =>
|
||||
[nextSibling] =>
|
||||
[attributes] =>
|
||||
[ownerDocument] =>
|
||||
[namespaceURI] =>
|
||||
|
||||
+1
-1
@@ -4203,7 +4203,7 @@ PHP_FUNCTION(exif_imagetype)
|
||||
php_stream * stream;
|
||||
int itype = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &imagefile, &imagefile_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &imagefile, &imagefile_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,23 +142,23 @@ Warning: exif_imagetype(0.5): failed to open stream: No such file or directory i
|
||||
bool(false)
|
||||
-- Iteration 10 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 11 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 12 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 13 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 14 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 15 --
|
||||
|
||||
@@ -198,7 +198,7 @@ Warning: exif_imagetype(obj'ct): failed to open stream: No such file or director
|
||||
bool(false)
|
||||
-- Iteration 24 --
|
||||
|
||||
Warning: exif_imagetype() expects parameter 1 to be string, resource given in %s on line %d
|
||||
Warning: exif_imagetype() expects parameter 1 to be a valid path, resource given in %s on line %d
|
||||
NULL
|
||||
-- Iteration 25 --
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ $context = stream_context_create(array('ssl' => array('local_cert' => dirname(__
|
||||
|
||||
for ($i=0; $i<10 && !$socket; ++$i) {
|
||||
$port = rand(50000, 65535);
|
||||
|
||||
$socket = stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
|
||||
|
||||
$socket = @stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
|
||||
}
|
||||
//set anther random port that is not the same as $port
|
||||
do{
|
||||
@@ -15,6 +15,7 @@ do{
|
||||
}while($pasv_port == $port);
|
||||
|
||||
if (!$socket) {
|
||||
echo "$errstr ($errno)\n";
|
||||
die("could not start/bind the ftp server\n");
|
||||
}
|
||||
|
||||
@@ -401,20 +402,34 @@ if ($pid) {
|
||||
|
||||
}elseif (preg_match('/^PASV/', $buf, $matches)) {
|
||||
$pasv=true;
|
||||
$p2 = $pasv_port % ((int) 1 << 8);
|
||||
$p1 = ($pasv_port-$p2)/((int) 1 << 8);
|
||||
$host = "127.0.0.1";
|
||||
if (!empty($ssl)) {
|
||||
$soc = stream_socket_server("tcp://127.0.0.1:$pasv_port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
|
||||
} else {
|
||||
$soc = stream_socket_server("tcp://127.0.0.1:$pasv_port");
|
||||
$i=0;
|
||||
|
||||
do {
|
||||
if (!empty($ssl)) {
|
||||
$soc = @stream_socket_server("tcp://127.0.0.1:$pasv_port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
|
||||
} else {
|
||||
$soc = @stream_socket_server("tcp://127.0.0.1:$pasv_port");
|
||||
}
|
||||
/* Could bind port, Try another port */
|
||||
if (!$soc) {
|
||||
$pasv_port = rand(50000, 65535);
|
||||
}
|
||||
$i++;
|
||||
} while ($i<10 && !$soc);
|
||||
|
||||
if (!$soc) {
|
||||
echo "$errstr ($errno)\n";
|
||||
die("could not bind passive port\n");
|
||||
}
|
||||
|
||||
$p2 = $pasv_port % ((int) 1 << 8);
|
||||
$p1 = ($pasv_port-$p2)/((int) 1 << 8);
|
||||
fputs($s, "227 Entering Passive Mode. (127,0,0,1,{$p1},{$p2})\r\n");
|
||||
|
||||
$pasvs = stream_socket_accept($soc,10);
|
||||
|
||||
}elseif (preg_match('/^EPSV/', $buf, $matches)) {
|
||||
} elseif (preg_match('/^EPSV/', $buf, $matches)) {
|
||||
fputs($s, "550 Extended passsive mode not supported.\r\n");
|
||||
} elseif (preg_match('/^SITE EXEC/', $buf, $matches)) {
|
||||
fputs($s, "200 OK\r\n");
|
||||
|
||||
@@ -368,6 +368,8 @@ ZEND_END_ARG_INFO()
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagepng, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, im)
|
||||
ZEND_ARG_INFO(0, filename)
|
||||
ZEND_ARG_INFO(0, quality)
|
||||
ZEND_ARG_INFO(0, filters)
|
||||
ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -152,7 +152,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
ctx = emalloc(sizeof(gdIOCtx));
|
||||
ctx = ecalloc(1, sizeof(gdIOCtx));
|
||||
ctx->putC = _php_image_output_putc;
|
||||
ctx->putBuf = _php_image_output_putbuf;
|
||||
ctx->gd_free = _php_image_output_ctxfree;
|
||||
@@ -165,7 +165,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
}
|
||||
|
||||
if (!ctx) {
|
||||
ctx = emalloc(sizeof(gdIOCtx));
|
||||
ctx = ecalloc(1, sizeof(gdIOCtx));
|
||||
ctx->putC = _php_image_stream_putc;
|
||||
ctx->putBuf = _php_image_stream_putbuf;
|
||||
if (close_stream) {
|
||||
|
||||
@@ -693,8 +693,6 @@ void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, in
|
||||
gdImagePtr gdImageRotate90(gdImagePtr src, int ignoretransparent);
|
||||
gdImagePtr gdImageRotate180(gdImagePtr src, int ignoretransparent);
|
||||
gdImagePtr gdImageRotate270(gdImagePtr src, int ignoretransparent);
|
||||
gdImagePtr gdImageRotate45(gdImagePtr src, double dAngle, int clrBack, int ignoretransparent);
|
||||
gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent);
|
||||
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor);
|
||||
|
||||
void gdImageSetBrush(gdImagePtr im, gdImagePtr brush);
|
||||
|
||||
+10
-2
@@ -136,6 +136,10 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
|
||||
GD2_DBG(php_gd_error("%d Chunks vertically", *ncy));
|
||||
|
||||
if (gd2_compressed(*fmt)) {
|
||||
if (*ncx <= 0 || *ncy <= 0 || *ncx > INT_MAX / *ncy) {
|
||||
GD2_DBG(printf ("Illegal chunk counts: %d * %d\n", *ncx, *ncy));
|
||||
goto fail1;
|
||||
}
|
||||
nc = (*ncx) * (*ncy);
|
||||
GD2_DBG(php_gd_error("Reading %d chunk index entries", nc));
|
||||
if (overflow2(sizeof(t_chunk_info), nc)) {
|
||||
@@ -340,12 +344,16 @@ gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
|
||||
for (x = xlo; x < xhi; x++) {
|
||||
if (im->trueColor) {
|
||||
if (!gdGetInt(&im->tpixels[y][x], in)) {
|
||||
im->tpixels[y][x] = 0;
|
||||
php_gd_error("gd2: EOF while reading\n");
|
||||
gdImageDestroy(im);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
int ch;
|
||||
if (!gdGetByte(&ch, in)) {
|
||||
ch = 0;
|
||||
php_gd_error("gd2: EOF while reading\n");
|
||||
gdImageDestroy(im);
|
||||
return NULL;
|
||||
}
|
||||
im->pixels[y][x] = ch;
|
||||
}
|
||||
|
||||
@@ -343,218 +343,3 @@ gdImagePtr gdImageRotate270 (gdImagePtr src, int ignoretransparent)
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent)
|
||||
{
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
gdImagePtr dst1,dst2,dst3;
|
||||
FuncPtr f;
|
||||
double dRadAngle, dSinE, dTan, dShear;
|
||||
double dOffset; /* Variable skew offset */
|
||||
int u, iShear, newx, newy;
|
||||
int clrBackR, clrBackG, clrBackB, clrBackA;
|
||||
|
||||
/* See GEMS I for the algorithm details */
|
||||
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
|
||||
dSinE = sin (dRadAngle);
|
||||
dTan = tan (dRadAngle / 2.0);
|
||||
|
||||
newx = (int)(src->sx + src->sy * fabs(dTan));
|
||||
newy = src->sy;
|
||||
|
||||
/* 1st shear */
|
||||
if (src->trueColor) {
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
|
||||
dst1 = gdImageCreateTrueColor(newx, newy);
|
||||
/******* Perform 1st shear (horizontal) ******/
|
||||
if (dst1 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
#ifdef HAVE_GD_BUNDLED
|
||||
dst1->alphaBlendingFlag = gdEffectReplace;
|
||||
#else
|
||||
gdImageAlphaBlending(dst1, 0);
|
||||
#endif
|
||||
if (dAngle == 0.0) {
|
||||
/* Returns copy of src */
|
||||
gdImageCopy (dst1, src,0,0,0,0,src->sx,src->sy);
|
||||
return dst1;
|
||||
}
|
||||
|
||||
gdImagePaletteCopy (dst1, src);
|
||||
|
||||
if (ignoretransparent) {
|
||||
if (gdImageTrueColor(src)) {
|
||||
dst1->transparent = src->transparent;
|
||||
} else {
|
||||
|
||||
dst1->transparent = gdTrueColorAlpha(gdImageRed(src, src->transparent), gdImageBlue(src, src->transparent), gdImageGreen(src, src->transparent), 127);
|
||||
}
|
||||
}
|
||||
|
||||
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
|
||||
dSinE = sin (dRadAngle);
|
||||
dTan = tan (dRadAngle / 2.0);
|
||||
|
||||
for (u = 0; u < dst1->sy; u++) {
|
||||
if (dTan >= 0.0) {
|
||||
dShear = ((double)(u + 0.5)) * dTan;
|
||||
} else {
|
||||
dShear = ((double)(u - dst1->sy) + 0.5) * dTan;
|
||||
}
|
||||
|
||||
iShear = (int)floor(dShear);
|
||||
gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack, ignoretransparent);
|
||||
}
|
||||
|
||||
/*
|
||||
The 1st shear may use the original clrBack as color index
|
||||
Convert it once here
|
||||
*/
|
||||
if(!src->trueColor) {
|
||||
clrBackR = gdImageRed(src, clrBack);
|
||||
clrBackG = gdImageGreen(src, clrBack);
|
||||
clrBackB = gdImageBlue(src, clrBack);
|
||||
clrBackA = gdImageAlpha(src, clrBack);
|
||||
clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA);
|
||||
}
|
||||
/* 2nd shear */
|
||||
newx = dst1->sx;
|
||||
|
||||
if (dSinE > 0.0) {
|
||||
dOffset = (src->sx-1) * dSinE;
|
||||
} else {
|
||||
dOffset = -dSinE * (src->sx - newx);
|
||||
}
|
||||
|
||||
newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle))+1;
|
||||
|
||||
if (src->trueColor) {
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst2 = gdImageCreateTrueColor(newx, newy);
|
||||
if (dst2 == NULL) {
|
||||
gdImageDestroy(dst1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GD_BUNDLED
|
||||
dst2->alphaBlendingFlag = gdEffectReplace;
|
||||
#else
|
||||
gdImageAlphaBlending(dst2, 0);
|
||||
#endif
|
||||
|
||||
if (ignoretransparent) {
|
||||
dst2->transparent = dst1->transparent;
|
||||
}
|
||||
|
||||
for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) {
|
||||
iShear = (int)floor (dOffset);
|
||||
gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack, ignoretransparent);
|
||||
}
|
||||
|
||||
/* 3rd shear */
|
||||
gdImageDestroy(dst1);
|
||||
|
||||
newx = (int) ((double)src->sy * fabs (dSinE) + (double)src->sx * cos (dRadAngle)) + 1;
|
||||
newy = dst2->sy;
|
||||
|
||||
if (src->trueColor) {
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst3 = gdImageCreateTrueColor(newx, newy);
|
||||
if (dst3 == NULL) {
|
||||
gdImageDestroy(dst2);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GD_BUNDLED
|
||||
dst3->alphaBlendingFlag = gdEffectReplace;
|
||||
#else
|
||||
gdImageAlphaBlending(dst3, 0);
|
||||
#endif
|
||||
|
||||
if (ignoretransparent) {
|
||||
dst3->transparent = dst2->transparent;
|
||||
}
|
||||
|
||||
if (dSinE >= 0.0) {
|
||||
dOffset = (double)(src->sx - 1) * dSinE * -dTan;
|
||||
} else {
|
||||
dOffset = dTan * ((double)(src->sx - 1) * -dSinE + (double)(1 - newy));
|
||||
}
|
||||
|
||||
for (u = 0; u < dst3->sy; u++, dOffset += dTan) {
|
||||
int iShear = (int)floor(dOffset);
|
||||
gdImageSkewX(dst3, dst2, u, iShear, (dOffset - iShear), clrBack, ignoretransparent);
|
||||
}
|
||||
|
||||
gdImageDestroy(dst2);
|
||||
|
||||
return dst3;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent)
|
||||
{
|
||||
gdImagePtr pMidImg;
|
||||
gdImagePtr rotatedImg;
|
||||
|
||||
if (src == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!gdImageTrueColor(src) && (clrBack < 0 || clrBack>=gdImageColorsTotal(src))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while (dAngle >= 360.0) {
|
||||
dAngle -= 360.0;
|
||||
}
|
||||
|
||||
while (dAngle < 0) {
|
||||
dAngle += 360.0;
|
||||
}
|
||||
|
||||
if (dAngle == 90.00) {
|
||||
return gdImageRotate90(src, ignoretransparent);
|
||||
}
|
||||
if (dAngle == 180.00) {
|
||||
return gdImageRotate180(src, ignoretransparent);
|
||||
}
|
||||
if(dAngle == 270.00) {
|
||||
return gdImageRotate270 (src, ignoretransparent);
|
||||
}
|
||||
|
||||
if ((dAngle > 45.0) && (dAngle <= 135.0)) {
|
||||
pMidImg = gdImageRotate90 (src, ignoretransparent);
|
||||
dAngle -= 90.0;
|
||||
} else if ((dAngle > 135.0) && (dAngle <= 225.0)) {
|
||||
pMidImg = gdImageRotate180 (src, ignoretransparent);
|
||||
dAngle -= 180.0;
|
||||
} else if ((dAngle > 225.0) && (dAngle <= 315.0)) {
|
||||
pMidImg = gdImageRotate270 (src, ignoretransparent);
|
||||
dAngle -= 270.0;
|
||||
} else {
|
||||
return gdImageRotate45 (src, dAngle, clrBack, ignoretransparent);
|
||||
}
|
||||
|
||||
if (pMidImg == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack, ignoretransparent);
|
||||
gdImageDestroy(pMidImg);
|
||||
|
||||
return rotatedImg;
|
||||
}
|
||||
/* End Rotate function */
|
||||
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ gdImagePtr gdImageCreateFromXbm(FILE * fd)
|
||||
max_bit = 32768;
|
||||
}
|
||||
if (max_bit) {
|
||||
bytes = (width * height / 8) + 1;
|
||||
bytes = (width + 7) / 8 * height;
|
||||
if (!bytes) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
--TEST--
|
||||
Bug #47946 (ImageConvolution overwrites background)
|
||||
--DESCRIPTION--
|
||||
The expected image has black pixel artifacts, what is another issue, though
|
||||
(perhaps #40158).
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
function array_flatten($array)
|
||||
{
|
||||
$tempArray = array();
|
||||
|
||||
foreach ($array as $value) {
|
||||
if (is_array($value)) {
|
||||
$tempArray = array_merge($tempArray, array_flatten($value));
|
||||
} else {
|
||||
$tempArray[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $tempArray;
|
||||
}
|
||||
|
||||
function makeFilter($resource, $matrix, $offset = 1.0)
|
||||
{
|
||||
$divisor = array_sum(array_flatten($matrix));
|
||||
if ($divisor == 0) {
|
||||
$divisor = .01;
|
||||
}
|
||||
return imageconvolution($resource, $matrix, $divisor, $offset);
|
||||
}
|
||||
|
||||
$edgeMatrix = array(array(1, 0, 1), array(0, 5, 0), array(1, 0, 1));
|
||||
|
||||
$im = imagecreatetruecolor(40, 40);
|
||||
imagealphablending($im, false);
|
||||
imagefilledrectangle($im, 0, 0, 39, 39, 0x7fffffff);
|
||||
imagefilledellipse($im, 19, 19, 20, 20, 0x00ff00);
|
||||
imagesavealpha($im, true);
|
||||
makeFilter($im, $edgeMatrix);
|
||||
|
||||
require_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug47946_exp.png', $im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
===DONE===
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 396 B |
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug 73868 (DOS vulnerability in gdImageCreateFromGd2Ctx())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73868.gd2'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromgd2(): gd2: EOF while reading
|
||||
in %s on line %d
|
||||
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #73869 (Signed Integer Overflow gd_io.c)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73869a.gd2'));
|
||||
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73869b.gd2'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #73968 (Premature failing of XBM reading)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatefromxbm(__DIR__ . DIRECTORY_SEPARATOR . 'bug73968.xbm');
|
||||
var_dump($im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
resource(%d) of type (gd)
|
||||
===DONE===
|
||||
@@ -0,0 +1,5 @@
|
||||
#define test_width 10
|
||||
#define test_height 10
|
||||
static unsigned char test_bits[] = {
|
||||
0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00,
|
||||
0xFF, 0x03, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00};
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
(Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$ref = new ReflectionFunction('imagepng');
|
||||
var_dump(count($ref->getParameters()));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4)
|
||||
@@ -11,9 +11,6 @@ $im = imagecreatefromxbm(dirname(__FILE__) . '/libgd00094.xbm');
|
||||
var_dump($im);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromxbm(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
|
||||
in %slibgd00094.php on line %d
|
||||
|
||||
Warning: imagecreatefromxbm(): '%slibgd00094.xbm' is not a valid XBM file in %slibgd00094.php on line %d
|
||||
bool(false)
|
||||
|
||||
@@ -3,8 +3,11 @@ PHP_ARG_WITH(gmp, for GNU MP support,
|
||||
|
||||
if test "$PHP_GMP" != "no"; then
|
||||
|
||||
MACHINE_INCLUDES=$($CC -dumpmachine)
|
||||
|
||||
for i in $PHP_GMP /usr/local /usr; do
|
||||
test -f $i/include/gmp.h && GMP_DIR=$i && break
|
||||
test -f $i/include/$MACHINE_INCLUDES/gmp.h && GMP_DIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$GMP_DIR"; then
|
||||
|
||||
+1
-1
@@ -783,7 +783,7 @@ static void php_hash_dtor(zend_resource *rsrc) /* {{{ */
|
||||
}
|
||||
|
||||
if (hash->key) {
|
||||
memset(hash->key, 0, hash->ops->block_size);
|
||||
ZEND_SECURE_ZERO(hash->key, hash->ops->block_size);
|
||||
efree(hash->key);
|
||||
}
|
||||
efree(hash);
|
||||
|
||||
Loaded 100 of 255 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user