Skip to content

Commit a4983d8

Browse files
committed
Merge branch 'master' into jit-dynasm
* master: Disable eliminatin of empty basic block with multiple predecessors [ci skip] Fix news entry format [ci skip] Fix news entry format [ci skip] Fix news entry format Fixed incorrect empty basic block removing Add test for ftp functions with bogus resource Refactor ftp_append test to clean temporary files Fixed typo fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop Fix LDFLAGS getting overwritten (ext/curl) Fixed arginfo for get_defined_functions Narrow typeinfos down for zend_parse_paramenters_none Fixed bug #46781 (BC math handles minus zero incorrectly)
2 parents 4736bdc + 7921e08 commit a4983d8

File tree

21 files changed

+395
-100
lines changed

21 files changed

+395
-100
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,7 @@ PHP NEWS
6868
- SPL:
6969
. Fixed bug #74977 (Appending AppendIterator leads to segfault).
7070
(Andrew Nester)
71+
. Fixed bug #75173 (incorrect behavior of AppendIterator::append in foreach loop).
72+
(jhdxr)
7173

7274
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

Zend/zend_builtin_functions.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_set_exception_handler, 0, 0, 1)
193193
ZEND_ARG_INFO(0, exception_handler)
194194
ZEND_END_ARG_INFO()
195195

196+
ZEND_BEGIN_ARG_INFO_EX(arginfo_get_defined_functions, 0, 0, 1)
197+
ZEND_ARG_INFO(0, exclude_disabled)
198+
ZEND_END_ARG_INFO()
199+
196200
ZEND_BEGIN_ARG_INFO_EX(arginfo_create_function, 0, 0, 2)
197201
ZEND_ARG_INFO(0, args)
198202
ZEND_ARG_INFO(0, code)
@@ -270,7 +274,7 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
270274
ZEND_FE(get_declared_classes, arginfo_zend__void)
271275
ZEND_FE(get_declared_traits, arginfo_zend__void)
272276
ZEND_FE(get_declared_interfaces, arginfo_zend__void)
273-
ZEND_FE(get_defined_functions, arginfo_zend__void)
277+
ZEND_FE(get_defined_functions, arginfo_get_defined_functions)
274278
ZEND_FE(get_defined_vars, arginfo_zend__void)
275279
ZEND_DEP_FE(create_function, arginfo_create_function)
276280
ZEND_FE(get_resource_type, arginfo_get_resource_type)

ext/bcmath/libbcmath/src/str2num.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,8 @@ bc_str2num (bc_num *num, char *str, int scale)
105105
for (;strscale > 0; strscale--)
106106
*nptr++ = CH_VAL(*ptr++);
107107
}
108+
109+
if (bc_is_zero (*num))
110+
(*num)->n_sign = PLUS;
108111
}
109112

ext/bcmath/tests/bug46781.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #46781 (BC math handles minus zero incorrectly)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
6+
?>
7+
--FILE--
8+
<?php
9+
var_dump(bcadd('-0.0', '-0.0', 1));
10+
var_dump(bccomp('-0.0', '0', 1));
11+
?>
12+
===DONE===
13+
--EXPECT--
14+
string(3) "0.0"
15+
int(0)
16+
===DONE===

ext/curl/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if test "$PHP_CURL" != "no"; then
9999

100100
save_CFLAGS="$CFLAGS"
101101
CFLAGS=$CURL_INCL
102-
save_LDFLAGS="$CFLAGS"
102+
save_LDFLAGS="$LDFLAGS"
103103
LDFLAGS=$CURL_LIBS
104104

105105
AC_PROG_CPP

ext/date/php_date.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,10 @@ PHP_FUNCTION(gmstrftime)
17571757
Return current UNIX timestamp */
17581758
PHP_FUNCTION(time)
17591759
{
1760+
if (zend_parse_parameters_none() == FAILURE) {
1761+
return;
1762+
}
1763+
17601764
RETURN_LONG((zend_long)time(NULL));
17611765
}
17621766
/* }}} */
@@ -4835,6 +4839,9 @@ PHP_FUNCTION(date_default_timezone_set)
48354839
PHP_FUNCTION(date_default_timezone_get)
48364840
{
48374841
timelib_tzinfo *default_tz;
4842+
if (zend_parse_parameters_none() == FAILURE) {
4843+
return;
4844+
}
48384845

48394846
default_tz = get_timezone_info();
48404847
RETVAL_STRING(default_tz->name);

ext/date/tests/date_default_timezone_get_error.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var_dump( date_default_timezone_get($extra_arg));
2222
*** Testing date_default_timezone_get() : error conditions ***
2323

2424
-- Testing date_create() function with more than expected no. of arguments --
25-
string(3) "UTC"
2625

27-
===Done===
26+
Warning: date_default_timezone_get() expects exactly 0 parameters, 1 given in %sdate_default_timezone_get_error.php on line %d
27+
NULL
28+
29+
===Done===

ext/date/tests/time_error.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ var_dump (time($extra_arg));
1515
===DONE===
1616
--EXPECTF--
1717
Too many arguments
18-
int(%d)
19-
===DONE===
18+
19+
Warning: time() expects exactly 0 parameters, 1 given in %stime_error.php on line %d
20+
NULL
21+
===DONE===

ext/ftp/tests/006.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var_dump(ftp_site($ftp));
3131
var_dump(ftp_set_option($ftp));
3232
var_dump(ftp_get_option($ftp));
3333
var_dump(ftp_mlsd($ftp));
34+
var_dump(ftp_append($ftp));
3435

3536
?>
3637
--EXPECTF--
@@ -102,3 +103,6 @@ NULL
102103

103104
Warning: ftp_mlsd() expects exactly 2 parameters, 1 given in %s006.php on line 26
104105
NULL
106+
107+
Warning: ftp_append() expects at least 3 parameters, 1 given in %s006.php on line 27
108+
NULL

ext/ftp/tests/007.phpt

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
--TEST--
2+
FTP with bogus resource
3+
--CREDITS--
4+
Michael Paul da Rosa <michael [at] michaelpaul [dot] com [dot] br>
5+
PHP TestFest Dublin 2017
6+
--SKIPIF--
7+
<?php
8+
require 'skipif.inc';
9+
?>
10+
--FILE--
11+
<?php
12+
$ftp = tmpfile();
13+
14+
var_dump(ftp_login($ftp, 'user', 'pass'));
15+
var_dump(ftp_pwd($ftp));
16+
var_dump(ftp_cdup($ftp));
17+
var_dump(ftp_chdir($ftp, '~'));
18+
var_dump(ftp_exec($ftp, 'x'));
19+
var_dump(ftp_raw($ftp, 'x'));
20+
var_dump(ftp_mkdir($ftp, '/'));
21+
var_dump(ftp_rmdir($ftp, '/'));
22+
var_dump(ftp_chmod($ftp, 7777, '/'));
23+
var_dump(ftp_alloc($ftp, 7777));
24+
var_dump(ftp_nlist($ftp, '/'));
25+
var_dump(ftp_rawlist($ftp, '~'));
26+
var_dump(ftp_mlsd($ftp, '~'));
27+
var_dump(ftp_systype($ftp));
28+
var_dump(ftp_fget($ftp, $ftp, 'remote', 7777));
29+
var_dump(ftp_nb_fget($ftp, $ftp, 'remote', 7777));
30+
var_dump(ftp_pasv($ftp, false));
31+
var_dump(ftp_get($ftp, 'local', 'remote', 7777));
32+
var_dump(ftp_nb_get($ftp, 'local', 'remote', 7777));
33+
var_dump(ftp_nb_continue($ftp));
34+
var_dump(ftp_fput($ftp, 'remote', $ftp, 9999));
35+
var_dump(ftp_nb_fput($ftp, 'remote', $ftp, 9999));
36+
var_dump(ftp_put($ftp, 'remote', 'local', 9999));
37+
var_dump(ftp_append($ftp, 'remote', 'local', 9999));
38+
var_dump(ftp_nb_put($ftp, 'remote', 'local', 9999));
39+
var_dump(ftp_size($ftp, '~'));
40+
var_dump(ftp_mdtm($ftp, '~'));
41+
var_dump(ftp_rename($ftp, 'old', 'new'));
42+
var_dump(ftp_delete($ftp, 'gone'));
43+
var_dump(ftp_site($ftp, 'localhost'));
44+
var_dump(ftp_close($ftp));
45+
var_dump(ftp_set_option($ftp, 1, 2));
46+
var_dump(ftp_get_option($ftp, 1));
47+
48+
fclose($ftp);
49+
?>
50+
--EXPECTF--
51+
Warning: ftp_login(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
52+
bool(false)
53+
54+
Warning: ftp_pwd(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
55+
bool(false)
56+
57+
Warning: ftp_cdup(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
58+
bool(false)
59+
60+
Warning: ftp_chdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
61+
bool(false)
62+
63+
Warning: ftp_exec(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
64+
bool(false)
65+
66+
Warning: ftp_raw(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
67+
bool(false)
68+
69+
Warning: ftp_mkdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
70+
bool(false)
71+
72+
Warning: ftp_rmdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
73+
bool(false)
74+
75+
Warning: ftp_chmod(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
76+
bool(false)
77+
78+
Warning: ftp_alloc(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
79+
bool(false)
80+
81+
Warning: ftp_nlist(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
82+
bool(false)
83+
84+
Warning: ftp_rawlist(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
85+
bool(false)
86+
87+
Warning: ftp_mlsd(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
88+
bool(false)
89+
90+
Warning: ftp_systype(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
91+
bool(false)
92+
93+
Warning: ftp_fget(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
94+
bool(false)
95+
96+
Warning: ftp_nb_fget(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
97+
bool(false)
98+
99+
Warning: ftp_pasv(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
100+
bool(false)
101+
102+
Warning: ftp_get(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
103+
bool(false)
104+
105+
Warning: ftp_nb_get(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
106+
bool(false)
107+
108+
Warning: ftp_nb_continue(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
109+
bool(false)
110+
111+
Warning: ftp_fput(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
112+
bool(false)
113+
114+
Warning: ftp_nb_fput(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
115+
bool(false)
116+
117+
Warning: ftp_put(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
118+
bool(false)
119+
120+
Warning: ftp_append(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
121+
bool(false)
122+
123+
Warning: ftp_nb_put(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
124+
bool(false)
125+
126+
Warning: ftp_size(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
127+
bool(false)
128+
129+
Warning: ftp_mdtm(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
130+
bool(false)
131+
132+
Warning: ftp_rename(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
133+
bool(false)
134+
135+
Warning: ftp_delete(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
136+
bool(false)
137+
138+
Warning: ftp_site(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
139+
bool(false)
140+
141+
Warning: ftp_close(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
142+
bool(false)
143+
144+
Warning: ftp_set_option(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
145+
bool(false)
146+
147+
Warning: ftp_get_option(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
148+
bool(false)

0 commit comments

Comments
 (0)