Skip to content

Commit d5a2af6

Browse files
committed
Merge branch 'PHP-7.0' of https://git.php.net/push/php-src into PHP-7.0
2 parents d26b880 + 344ef05 commit d5a2af6

File tree

83 files changed

+3640
-2762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3640
-2762
lines changed

NEWS

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,81 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? 2016 PHP 7.0.14
3+
?? ??? 2016 PHP 7.0.15
44

5-
- Calendar:
6-
. Fix integer overflows (Joshua Rogers)
5+
- Core:
6+
. Fixed bug #73585 (Logging of "Internal Zend error - Missing class
7+
information" missing class name). (Laruence)
8+
9+
- PCRE:
10+
. Fixed bug #73612 (preg_*() may leak memory). (cmb)
11+
12+
- Streams:
13+
. Fixed bug #73586 (php_user_filter::$stream is not set to the stream the
14+
filter is working on). (Dmitry)
15+
16+
- Phpdbg:
17+
. Fixed bug #73615 (phpdbg without option never load .phpdbginit at startup).
18+
(Bob)
19+
20+
08 Dec 2016 PHP 7.0.14
721

822
- Core:
23+
. Fixed memory leak(null coalescing operator with Spl hash). (Tyson Andre)
924
. Fixded bug #72736 (Slow performance when fetching large dataset with mysqli
1025
/ PDO). (Dmitry)
1126

27+
- Calendar:
28+
. Fix integer overflows (Joshua Rogers)
29+
1230
- Date:
1331
. Fixed bug #69587 (DateInterval properties and isset). (jhdxr)
1432

33+
- DTrace:
34+
. Disabled PHP call tracing by default (it makes significant overhead).
35+
This may be enabled again using envirionment variable USE_ZEND_DTRACE=1.
36+
(Dmitry)
37+
38+
- JSON:
39+
. Fixed bug #73526 (php_json_encode depth issue). (Jakub Zelenka)
40+
41+
- Mysqlnd:
42+
. Fixed bug #64526 (Add missing mysqlnd.* parameters to php.ini-*). (cmb)
43+
1544
- ODBC:
1645
. Fixed bug #73448 (odbc_errormsg returns trash, always 513 bytes).
1746
(Anatol)
1847

1948
- Opcache:
20-
. Fixed bug #69090 (check cached files permissions)
49+
. Fixed bug #69090 (check cached files permissions). (dmitry)
50+
. Fixed bug #73546 (Logging for opcache has an empty file name). (mhagstrand)
2151

2252
- PCRE:
53+
. Fixed bug #73483 (Segmentation fault on pcre_replace_callback). (Laruence)
2354
. Fixed bug #73392 (A use-after-free in zend allocator management).
2455
(Laruence)
2556

2657
- PDO_Firebird:
2758
. Fixed bug #73087, #61183, #71494 (Memory corruption in bindParam).
2859
(Dorin Marcoci)
2960

61+
- Postgres:
62+
. Fixed bug #73498 (Incorrect SQL generated for pg_copy_to()). (Craig Duncan)
63+
64+
- Soap:
65+
. Fixed bug #73538 (SoapClient::__setSoapHeaders doesn't overwrite SOAP
66+
headers). (duncan3dc)
67+
. Fixed bug #73452 (Segfault (Regression for #69152)). (Dmitry)
68+
3069
- SPL:
3170
. Fixed bug #73423 (Reproducible crash with GDB backtrace). (Laruence)
3271

3372
- SQLite3:
3473
. Fixed bug #73530 (Unsetting result set may reset other result set). (cmb)
3574

75+
- Standard:
76+
. Fixed bug #73297 (HTTP stream wrapper should ignore HTTP 100 Continue).
77+
(rowan dot collins at gmail dot com)
78+
3679
- XML:
3780
. Fixed bug #72135 (malformed XML causes fault) (edgarsandi)
3881

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Calling generator through magic __call()
3+
--FILE--
4+
<?php
5+
class A {
6+
public function __call($name, $args) {
7+
for ($i = 0; $i < 5; $i++) {
8+
yield $i;
9+
}
10+
}
11+
}
12+
13+
$a = new A();
14+
foreach ($a->gen() as $n) {
15+
var_dump($n);
16+
}
17+
$a->gen();
18+
?>
19+
--EXPECT--
20+
int(0)
21+
int(1)
22+
int(2)
23+
int(3)
24+
int(4)

Zend/zend.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,19 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
678678

679679
#if HAVE_DTRACE
680680
/* build with dtrace support */
681-
zend_compile_file = dtrace_compile_file;
682-
zend_execute_ex = dtrace_execute_ex;
683-
zend_execute_internal = dtrace_execute_internal;
681+
{
682+
char *tmp = getenv("USE_ZEND_DTRACE");
683+
684+
if (tmp && zend_atoi(tmp, 0)) {
685+
zend_compile_file = dtrace_compile_file;
686+
zend_execute_ex = dtrace_execute_ex;
687+
zend_execute_internal = dtrace_execute_internal;
688+
} else {
689+
zend_compile_file = compile_file;
690+
zend_execute_ex = execute_ex;
691+
zend_execute_internal = NULL;
692+
}
693+
}
684694
#else
685695
zend_compile_file = compile_file;
686696
zend_execute_ex = execute_ex;

Zend/zend_compile.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,10 +1002,8 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze
10021002
op1 = RT_CONSTANT(op_array, opline->op1);
10031003
op2 = RT_CONSTANT(op_array, opline->op2);
10041004
}
1005-
if ((ce = zend_hash_find_ptr(class_table, Z_STR_P(op1))) == NULL) {
1006-
zend_error_noreturn(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1));
1007-
return NULL;
1008-
}
1005+
ce = zend_hash_find_ptr(class_table, Z_STR_P(op1));
1006+
ZEND_ASSERT(ce);
10091007
ce->refcount++;
10101008
if (zend_hash_add_ptr(class_table, Z_STR_P(op2), ce) == NULL) {
10111009
ce->refcount--;

Zend/zend_execute.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,11 +1412,11 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object,
14121412
zval rv;
14131413

14141414
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
1415-
zval *z, obj;
1415+
zval *z, *zptr, obj;
14161416

14171417
ZVAL_OBJ(&obj, Z_OBJ_P(object));
14181418
Z_ADDREF(obj);
1419-
z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
1419+
zptr = z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
14201420
if (UNEXPECTED(EG(exception))) {
14211421
OBJ_RELEASE(Z_OBJ(obj));
14221422
return;
@@ -1443,7 +1443,7 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object,
14431443
}
14441444
Z_OBJ_HT(obj)->write_property(&obj, property, z, cache_slot);
14451445
OBJ_RELEASE(Z_OBJ(obj));
1446-
zval_ptr_dtor(z);
1446+
zval_ptr_dtor(zptr);
14471447
} else {
14481448
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
14491449
if (UNEXPECTED(result)) {

Zend/zend_hash.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@ static zend_always_inline zval *zend_hash_str_find_ind(const HashTable *ht, cons
301301
}
302302

303303

304+
static zend_always_inline int zend_hash_str_exists_ind(const HashTable *ht, const char *str, size_t len)
305+
{
306+
zval *zv;
307+
308+
zv = zend_hash_str_find(ht, str, len);
309+
return zv && (Z_TYPE_P(zv) != IS_INDIRECT ||
310+
Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF);
311+
}
312+
313+
304314
static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
305315
{
306316
zend_ulong idx;

Zend/zend_ini_parser.y

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ int ini_parse(void);
4646
#define YYFREE free
4747
#endif
4848

49+
#define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
50+
4951
/* {{{ zend_ini_do_op()
5052
*/
5153
static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
@@ -86,15 +88,19 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
8688
}
8789

8890
str_len = zend_sprintf(str_result, "%d", i_result);
89-
ZVAL_PSTRINGL(result, str_result, str_len);
91+
ZVAL_NEW_STR(result, zend_string_init(str_result, str_len, ZEND_SYSTEM_INI));
9092
}
9193
/* }}} */
9294

9395
/* {{{ zend_ini_init_string()
9496
*/
9597
static void zend_ini_init_string(zval *result)
9698
{
97-
ZVAL_EMPTY_PSTRING(result);
99+
if (ZEND_SYSTEM_INI) {
100+
ZVAL_EMPTY_PSTRING(result);
101+
} else {
102+
ZVAL_EMPTY_STRING(result);
103+
}
98104
}
99105
/* }}} */
100106

@@ -107,8 +113,12 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
107113
if (Z_TYPE_P(op1) != IS_STRING) {
108114
zend_string *str = zval_get_string(op1);
109115
/* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
110-
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
111-
zend_string_release(str);
116+
if (ZEND_SYSTEM_INI) {
117+
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
118+
zend_string_release(str);
119+
} else {
120+
ZVAL_STR(op1, str);
121+
}
112122
}
113123
op1_len = (int)Z_STRLEN_P(op1);
114124

@@ -117,7 +127,7 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
117127
}
118128
length = op1_len + (int)Z_STRLEN_P(op2);
119129

120-
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, 1));
130+
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, ZEND_SYSTEM_INI));
121131
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
122132
}
123133
/* }}} */
@@ -140,7 +150,7 @@ static void zend_ini_get_constant(zval *result, zval *name)
140150
convert_to_string(&tmp);
141151
c = &tmp;
142152
}
143-
ZVAL_PSTRINGL(result, Z_STRVAL_P(c), Z_STRLEN_P(c));
153+
ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(c), Z_STRLEN_P(c), ZEND_SYSTEM_INI));
144154
if (c == &tmp) {
145155
zend_string_release(Z_STR(tmp));
146156
}
@@ -160,11 +170,11 @@ static void zend_ini_get_var(zval *result, zval *name)
160170

161171
/* Fetch configuration option value */
162172
if ((curval = zend_get_configuration_directive(Z_STR_P(name))) != NULL) {
163-
ZVAL_PSTRINGL(result, Z_STRVAL_P(curval), Z_STRLEN_P(curval));
173+
ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(curval), Z_STRLEN_P(curval), ZEND_SYSTEM_INI));
164174
/* ..or if not found, try ENV */
165175
} else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name))) != NULL ||
166176
(envvar = getenv(Z_STRVAL_P(name))) != NULL) {
167-
ZVAL_PSTRING(result, envvar);
177+
ZVAL_NEW_STR(result, zend_string_init(envvar, strlen(envvar), ZEND_SYSTEM_INI));
168178
} else {
169179
zend_ini_init_string(result);
170180
}
@@ -282,6 +292,8 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
282292
%left '|' '&' '^'
283293
%right '~' '!'
284294
295+
%destructor { zval_ptr_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL
296+
285297
%%
286298
287299
statement_list:

0 commit comments

Comments
 (0)