Skip to content

Commit f8ee809

Browse files
committed
Merge branch 'master' of https://git.php.net/repository/php-src
2 parents 9047b56 + 7373da7 commit f8ee809

32 files changed

+485
-205
lines changed

NEWS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@ PHP NEWS
33
03 Sep 2015, PHP 7.0.0 RC 2
44

55
- Core:
6+
. Fixed bug #70145 (From field incorrectly parsed from headers). (Anatol)
7+
. Fixed bug #70300 (Syntactical inconsistency with new group use syntax).
8+
(marcio dot web2 at gmail dot com)
69
. Fixed bug causing exception traces with anon classes to be truncated. (Bob)
710

11+
- SPL:
12+
. Fixed bug #70303 (Incorrect constructor reflection for ArrayObject). (cmb)
13+
814
- Standard:
915
. Fixed bug #70295 (Segmentation fault with setrawcookie). (Bob)
1016

1117
20 Aug 2015, PHP 7.0.0 RC 1
1218

1319
- Core:
20+
. Fixed bug #70299 (Memleak while assigning object offsetGet result).
21+
(Laruence)
1422
. Fixed bug #70288 (Apache crash related to ZEND_SEND_REF). (Laruence)
1523
. Fixed bug #70262 (Accessing array crashes PHP 7.0beta3).
1624
(Laruence, Dmitry)

Zend/tests/ns_094.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Type group use declarations should not allow override on inner itens
33
--FILE--
44
<?php
55

6-
// should not throw syntax errors
6+
// should throw syntax errors
77

88
use const Foo\Bar\{
99
A,

Zend/tests/ns_095.phpt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--TEST--
2+
Absolute namespaces should be allowed
3+
--FILE--
4+
<?php
5+
6+
namespace Foo\Bar {
7+
class ClassA{}
8+
class ClassB{}
9+
class ClassC{}
10+
11+
function fn_a(){ return __FUNCTION__; }
12+
function fn_b(){ return __FUNCTION__; }
13+
function fn_c(){ return __FUNCTION__; }
14+
15+
const CONST_A = 1;
16+
const CONST_B = 2;
17+
const CONST_C = 3;
18+
}
19+
20+
namespace Baz {
21+
22+
use \Foo\Bar\{ClassA, ClassB, ClassC};
23+
use function \Foo\Bar\{fn_a, fn_b, fn_c};
24+
use const \Foo\Bar\{CONST_A, CONST_B, CONST_C};
25+
26+
var_dump(ClassA::class);
27+
var_dump(ClassB::class);
28+
var_dump(ClassC::class);
29+
var_dump(fn_a());
30+
var_dump(fn_b());
31+
var_dump(fn_c());
32+
var_dump(CONST_A);
33+
var_dump(CONST_B);
34+
var_dump(CONST_C);
35+
36+
echo "\nDone\n";
37+
}
38+
?>
39+
--EXPECTF--
40+
41+
string(14) "Foo\Bar\ClassA"
42+
string(14) "Foo\Bar\ClassB"
43+
string(14) "Foo\Bar\ClassC"
44+
string(12) "Foo\Bar\fn_a"
45+
string(12) "Foo\Bar\fn_b"
46+
string(12) "Foo\Bar\fn_c"
47+
int(1)
48+
int(2)
49+
int(3)
50+
51+
Done

Zend/zend.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
880880
/* }}} */
881881

882882
/* this should be compatible with the standard zenderror */
883-
void zenderror(const char *error) /* {{{ */
883+
ZEND_COLD void zenderror(const char *error) /* {{{ */
884884
{
885885
if (EG(exception)) {
886886
/* An exception was thrown in the lexer, don't throw another in the parser. */
@@ -892,7 +892,7 @@ void zenderror(const char *error) /* {{{ */
892892
/* }}} */
893893

894894
BEGIN_EXTERN_C()
895-
ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
895+
ZEND_API ZEND_COLD void _zend_bailout(char *filename, uint lineno) /* {{{ */
896896
{
897897

898898
if (!EG(bailout)) {
@@ -1032,9 +1032,9 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */
10321032
} while (0)
10331033

10341034
#if !defined(HAVE_NORETURN) || defined(HAVE_NORETURN_ALIAS)
1035-
ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
1035+
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) /* {{{ */
10361036
#else
1037-
static void zend_error_va_list(int type, const char *format, va_list args)
1037+
static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list args)
10381038
#endif
10391039
{
10401040
char *str;
@@ -1274,9 +1274,9 @@ static void zend_error_va_list(int type, const char *format, va_list args)
12741274

12751275
#ifdef HAVE_NORETURN
12761276
# ifdef HAVE_NORETURN_ALIAS
1277-
void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn));
1277+
ZEND_COLD void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn));
12781278
# else
1279-
ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
1279+
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) /* {{{ */
12801280
{
12811281
va_list va;
12821282

@@ -1285,7 +1285,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
12851285
va_end(va);
12861286
}
12871287

1288-
ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...)
1288+
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...)
12891289
{
12901290
va_list va;
12911291

@@ -1297,7 +1297,7 @@ ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ..
12971297
# endif
12981298
#endif
12991299

1300-
ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
1300+
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
13011301
{
13021302
va_list va;
13031303
char *message = NULL;
@@ -1326,7 +1326,7 @@ ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *forma
13261326
}
13271327
/* }}} */
13281328

1329-
ZEND_API void zend_type_error(const char *format, ...) /* {{{ */
1329+
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) /* {{{ */
13301330
{
13311331
va_list va;
13321332
char *message = NULL;
@@ -1338,7 +1338,7 @@ ZEND_API void zend_type_error(const char *format, ...) /* {{{ */
13381338
va_end(va);
13391339
} /* }}} */
13401340

1341-
ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
1341+
ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
13421342
{
13431343
va_list va;
13441344
char *message = NULL;
@@ -1355,7 +1355,7 @@ ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *fo
13551355
va_end(va);
13561356
} /* }}} */
13571357

1358-
ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
1358+
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
13591359
{
13601360
#if ZEND_DEBUG
13611361
va_list args;

Zend/zend.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
ZEND_TSRMLS_CACHE_EXTERN();
7878

7979
#ifdef HAVE_NORETURN
80-
# ifdef ZEND_NORETRUN_ALIAS
81-
void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN;
80+
# ifdef ZEND_NORETURN_ALIAS
81+
ZEND_COLD void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN;
8282
# else
83-
ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...);
83+
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...);
8484
# endif
8585
#else
8686
# define zend_error_noreturn zend_error
@@ -240,7 +240,7 @@ void zend_register_standard_ini_entries(void);
240240
void zend_post_startup(void);
241241
void zend_set_utility_values(zend_utility_values *utility_values);
242242

243-
ZEND_API void _zend_bailout(char *filename, uint lineno);
243+
ZEND_API ZEND_COLD void _zend_bailout(char *filename, uint lineno);
244244

245245
ZEND_API char *get_zend_version(void);
246246
ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy);
@@ -249,7 +249,7 @@ ZEND_API size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int
249249
ZEND_API void zend_print_zval_r(zval *expr, int indent);
250250
ZEND_API void zend_print_flat_zval_r(zval *expr);
251251
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent);
252-
ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
252+
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
253253

254254
ZEND_API void zend_activate(void);
255255
ZEND_API void zend_deactivate(void);
@@ -284,10 +284,10 @@ extern zend_string *(*zend_vstrpprintf)(size_t max_len, const char *format, va_l
284284
extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
285285
extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, int filename_len);
286286

287-
ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
288-
ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...);
289-
ZEND_API void zend_type_error(const char *format, ...);
290-
ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *format, ...);
287+
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
288+
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...);
289+
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...);
290+
ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...);
291291

292292
void zenderror(const char *error);
293293

Zend/zend_API.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array) /
149149
}
150150
/* }}} */
151151

152-
ZEND_API void zend_wrong_param_count(void) /* {{{ */
152+
ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */
153153
{
154154
const char *space;
155155
const char *class_name = get_active_class_name(&space);
@@ -196,7 +196,7 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
196196
/* }}} */
197197

198198
#ifdef FAST_ZPP
199-
ZEND_API void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
199+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
200200
{
201201
zend_function *active_function = EG(current_execute_data)->func;
202202
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
@@ -212,7 +212,7 @@ ZEND_API void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int mi
212212
}
213213
/* }}} */
214214

215-
ZEND_API void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg) /* {{{ */
215+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg) /* {{{ */
216216
{
217217
const char *space;
218218
const char *class_name = get_active_class_name(&space);
@@ -226,7 +226,7 @@ ZEND_API void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected
226226
}
227227
/* }}} */
228228

229-
ZEND_API void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name, zval *arg) /* {{{ */
229+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name, zval *arg) /* {{{ */
230230
{
231231
const char *space;
232232
const char *class_name = get_active_class_name(&space);
@@ -236,7 +236,7 @@ ZEND_API void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name,
236236
}
237237
/* }}} */
238238

239-
ZEND_API void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, char *error) /* {{{ */
239+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, char *error) /* {{{ */
240240
{
241241
const char *space;
242242
const char *class_name = get_active_class_name(&space);
@@ -790,7 +790,7 @@ ZEND_API int zend_parse_parameter(int flags, int arg_num, zval *arg, const char
790790
return ret;
791791
}
792792

793-
static void zend_parse_parameters_debug_error(const char *msg) {
793+
static ZEND_COLD void zend_parse_parameters_debug_error(const char *msg) {
794794
zend_function *active_function = EG(current_execute_data)->func;
795795
const char *class_name = active_function->common.scope
796796
? ZSTR_VAL(active_function->common.scope->name) : "";

Zend/zend_API.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zen
300300
ZEND_API int zend_disable_function(char *function_name, size_t function_name_length);
301301
ZEND_API int zend_disable_class(char *class_name, size_t class_name_length);
302302

303-
ZEND_API void zend_wrong_param_count(void);
303+
ZEND_API ZEND_COLD void zend_wrong_param_count(void);
304304

305305
#define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0)
306306
#define IS_CALLABLE_CHECK_NO_ACCESS (1<<1)
@@ -691,10 +691,10 @@ typedef enum _zend_expected_type {
691691
Z_EXPECTED_LAST
692692
} zend_expected_type;
693693

694-
ZEND_API void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args);
695-
ZEND_API void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg);
696-
ZEND_API void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name, zval *arg);
697-
ZEND_API void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, char *error);
694+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args);
695+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg);
696+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name, zval *arg);
697+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, char *error);
698698

699699
#define ZPP_ERROR_OK 0
700700
#define ZPP_ERROR_FAILURE 1

Zend/zend_alloc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static const int bin_pages[] = {
338338
};
339339

340340
#if ZEND_DEBUG
341-
void zend_debug_alloc_output(char *format, ...)
341+
ZEND_COLD void zend_debug_alloc_output(char *format, ...)
342342
{
343343
char output_buf[256];
344344
va_list args;
@@ -355,7 +355,7 @@ void zend_debug_alloc_output(char *format, ...)
355355
}
356356
#endif
357357

358-
static ZEND_NORETURN void zend_mm_panic(const char *message)
358+
static ZEND_COLD ZEND_NORETURN void zend_mm_panic(const char *message)
359359
{
360360
fprintf(stderr, "%s\n", message);
361361
/* See http://support.microsoft.com/kb/190351 */
@@ -368,7 +368,7 @@ static ZEND_NORETURN void zend_mm_panic(const char *message)
368368
exit(1);
369369
}
370370

371-
static ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,
371+
static ZEND_COLD ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,
372372
const char *format,
373373
size_t limit,
374374
#if ZEND_DEBUG

Zend/zend_closures.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ ZEND_METHOD(Closure, bind)
205205
}
206206
/* }}} */
207207

208-
static zend_function *zend_closure_get_constructor(zend_object *object) /* {{{ */
208+
static ZEND_COLD zend_function *zend_closure_get_constructor(zend_object *object) /* {{{ */
209209
{
210210
zend_throw_error(NULL, "Instantiation of 'Closure' is not allowed");
211211
return NULL;
@@ -448,7 +448,7 @@ static HashTable *zend_closure_get_gc(zval *obj, zval **table, int *n) /* {{{ */
448448

449449
/* {{{ proto Closure::__construct()
450450
Private constructor preventing instantiation */
451-
ZEND_METHOD(Closure, __construct)
451+
ZEND_COLD ZEND_METHOD(Closure, __construct)
452452
{
453453
zend_throw_error(NULL, "Instantiation of 'Closure' is not allowed");
454454
}

0 commit comments

Comments
 (0)