Skip to content

Commit bb42643

Browse files
committed
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src: (107 commits) Typo fix: umknown -> unknown add news entry about FPM backlog change Fix bug #66008 updated libs_versions.txt Update NEWS Update NEWS Fixed Bug 64760 var_export() does not use full precision for floating-point numbers add bundled libzip LICENSE, as required by BSD License terms - Updated to version 2013.8 (2013h) Use zval* instead of zval** Increased limit for opcache.max_accelerated_files to 1,000,000. (Chris) Improved performance of array_merge() by eliminating useless copying Improved performance of func_get_args() by eliminating useless copying Link to more readmes increase backlog to the highest value everywhere Update NEWS Fixed bug #65950 Field name truncation if the field name is bigger than 32 characters - Updated to version 2013.7 (2013g) Increment version number, since this will be 5.5.6. Added Zend Debugger to the note about the load order (by trash4you at online dot de) ...
2 parents 6b68f44 + 55ee543 commit bb42643

File tree

157 files changed

+5561
-1492
lines changed

Some content is hidden

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

157 files changed

+5561
-1492
lines changed

CODING_STANDARDS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Naming Conventions
151151

152152
7. Classes should be given descriptive names. Avoid using abbreviations where
153153
possible. Each word in the class name should start with a capital letter,
154-
without underscore delimiters (CampelCaps starting with a capital letter).
154+
without underscore delimiters (CamelCaps starting with a capital letter).
155155
The class name should be prefixed with the name of the 'parent set' (e.g.
156156
the name of the extension)::
157157

NEWS

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,50 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? 2013, PHP 5.5.5
3+
?? ??? 2013, PHP 5.5.6
4+
5+
- Core:
6+
. Improved performance of array_merge() and func_get_args() by eliminating
7+
useless copying. (Dmitry)
8+
. Fixed bug #65939 (Space before ";" breaks php.ini parsing).
9+
(brainstorm at nopcode dot org)
10+
. Fixed bug #65911 (scope resolution operator - strange behavior with $this).
11+
(Bob Weinand)
12+
. Fixed bug #65936 (dangling context pointer causes crash). (Tony)
13+
14+
- FPM:
15+
. Changed default listen() backlog to 65535. (Tony)
16+
17+
- OPcache
18+
. Increased limit for opcache.max_accelerated_files to 1,000,000. (Chris)
19+
20+
- ODBC
21+
. Fixed bug #65950 (Field name truncation if the field name is bigger than
22+
32 characters). (patch submitted by: michael dot y at zend dot com, Yasuo)
23+
24+
- Standard:
25+
. Fixed bug #64760 (var_export() does not use full precision for floating-point
26+
numbers) (Yasuo)
27+
28+
29+
17 Oct 2013, PHP 5.5.5
430

531
- Core:
632
. Fixed bug #64979 (Wrong behavior of static variables in closure generators).
733
(Nikita)
34+
. Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita)
35+
. Fixed bug #65821 (By-ref foreach on property access of string offset
36+
segfaults). (Nikita)
837

938
- CLI server:
1039
. Fixed bug #65633 (built-in server treat some http headers as
1140
case-sensitive). (Adam)
41+
. Fixed bug #65818 (Segfault with built-in webserver and chunked transfer
42+
encoding). (Felipe)
1243
. Added application/pdf to PHP CLI Web Server mime types (Chris Jones)
1344

1445
- Datetime:
46+
. Fixed bug #64157 (DateTime::createFromFormat() reports confusing error
47+
message). (Boro Sitnikovski)
1548
. Fixed bug #65502 (DateTimeImmutable::createFromFormat returns DateTime).
1649
(Boro Sitnikovski)
1750
. Fixed bug #65548 (Comparison for DateTimeImmutable doesn't work).
@@ -21,6 +54,14 @@ PHP NEWS
2154
. Fixed bug #65708 (dba functions cast $key param to string in-place,
2255
bypassing copy on write). (Adam)
2356

57+
- Filter:
58+
. Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn)
59+
. Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names).
60+
(Syra)
61+
62+
- FTP:
63+
. Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)
64+
2465
- GD
2566
. Ensure that the defined interpolation method is used with the generic
2667
scaling methods. (Pierre)
@@ -30,19 +71,41 @@ PHP NEWS
3071
imap). (ryotakatsuki at gmail dot com)
3172

3273
- OPcache:
74+
. Fixed issue #115 (path issue when using phar). (Laruence)
3375
. Added support for GNU Hurd. (Svante Signell)
3476
. Added function opcache_compile_file() to load PHP scripts into cache
3577
without execution. (Julien)
78+
. Fixed bug #65845 (Error when Zend Opcache Optimizer is fully enabled).
79+
(Dmitry)
3680
. Fixed bug #65665 (Exception not properly caught when opcache enabled).
3781
(Laruence)
3882
. Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var). (Dmitry)
3983
. Fixed issue #135 (segfault in interned strings if initial memory is too
4084
low). (Julien)
4185

86+
- Sockets:
87+
. Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
88+
(Mike)
89+
4290
- SPL:
4391
. Fix bug #64782 (SplFileObject constructor make $context optional / give it
4492
a default value). (Nikita)
4593

94+
- Standard:
95+
. Fixed bug #61548 (content-type must appear at the end of headers for 201
96+
Location to work in http). (Mike)
97+
98+
- XMLReader:
99+
. Fixed bug #51936 (Crash with clone XMLReader). (Mike)
100+
. Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
101+
102+
- Build system:
103+
. Fixed bug #51076 (race condition in shtool's mkdir -p implementation).
104+
(Mike, Raphael Geissert)
105+
. Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing
106+
gzencode())). (Mike)
107+
108+
46109
19 Sep 2013, PHP 5.5.4
47110

48111
- Core:
@@ -53,6 +116,7 @@ PHP NEWS
53116
DTRACE_FUNCTION_*). (Chris Jones)
54117
. Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding
55118
spaces). (Michael M Slusarz)
119+
. Fixed bug #65481 (shutdown segfault due to serialize) (Mike)
56120
. Fixed bug #65470 (Segmentation fault in zend_error() with
57121
--enable-dtrace). (Chris Jones, Kris Van Hees)
58122
. Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)
@@ -79,6 +143,10 @@ PHP NEWS
79143
. Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
80144
some cases). (Mark Jones)
81145

146+
- PDO:
147+
. Fixed bug #64953 (Postgres prepared statement positional parameter
148+
casting). (Mike)
149+
82150
- Session:
83151
. Fixed bug #65475 (Session ID is not initialized properly when strict session
84152
is enabled). (Yasuo)
@@ -89,6 +157,10 @@ PHP NEWS
89157
. Fix issue with return types of password API helper functions. Found via
90158
static analysis by cjones. (Anthony Ferrara)
91159

160+
- Zlib:
161+
. Fixed bug #65391 (Unable to send vary header user-agent when
162+
ob_start('ob_gzhandler') is called) (Mike)
163+
92164
22 Aug 2013, PHP 5.5.3
93165

94166
- Openssl:

README.EXTENSIONS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ zend_module_entry foo_module_entry = {
3030
PHP_RSHUTDOWN(foo), /* per-request shutdown function */
3131
PHP_MINFO(foo), /* information function */
3232
#if ZEND_MODULE_API_NO >= 20010901
33-
FOO_VERSION, /* extension version number (string) */
33+
PHP_FOO_VERSION, /* extension version number (string) */
3434
#endif
3535
STANDARD_MODULE_PROPERTIES
3636
};

README.EXT_SKEL

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ HOW TO USE IT
3131

3232
./buildconf; ./configure --enable-module_name; make
3333

34+
The definition of PHP_MODULE_NAME_VERSION will be present in the
35+
php_module_name.h and injected into the zend_module_entry definition. This
36+
is required by the PECL website for the version string conformity checks
37+
against package.xml
38+
3439
But if you already have planned the overall scheme of your module, what
3540
functions it will contain, their return types and the arguments they take
3641
(a very good idea) and don't want to bother yourself with creating function

README.SELF-CONTAINED-EXTENSIONS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,18 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
153153
#ifdef COMPILE_DL_FOO
154154
ZEND_GET_MODULE(foo)
155155
#endif
156+
157+
PECL SITE CONFORMITY
158+
159+
If you plan to release an extension to the PECL website, there are several
160+
points to be regarded.
161+
162+
1. Add LICENSE or COPYING to the package.xml
163+
164+
2. The following should be defined in one of the extension header files
165+
166+
#define PHP_FOO_VERSION "1.2.3"
167+
168+
This macros has to be used within your foo_module_entry to indicate the
169+
extension version.
170+

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
1717
information on the process.
1818

1919
Bug fixes **do not** require an RFC, but require a bugtracker ticket. Always
20-
open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN.
20+
open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN.
2121

2222
Fix #55371: get_magic_quotes_gpc() throws deprecation warning
2323

@@ -28,3 +28,12 @@ open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN.
2828

2929
We do not merge pull requests directly on github. All PRs will be
3030
pulled and pushed through http://git.php.net.
31+
32+
33+
Guidelines for contributors
34+
===========================
35+
- [CODING_STANDARDS](/CODING_STANDARDS)
36+
- [README.GIT-RULES](/README.GIT-RULES)
37+
- [README.MAILINGLIST_RULES](/README.MAILINGLIST_RULES)
38+
- [README.RELEASE_PROCESS](/README.RELEASE_PROCESS)
39+

UPGRADING

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ None
343343

344344
- Intl:
345345
- This extension now requires ICU 4.0+.
346+
- Phar:
347+
- Added ability of resolving alias created by Phar::map
346348

347349
========================================
348350
9. New Global Constants

Zend/acinclude.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
1212
bison_version=none
1313
if test "$YACC"; then
1414
AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
15-
bison_version_vars=`bison --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /' | tr -d a-z`
15+
bison_version_vars=`$YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /g' | tr -d a-z`
1616
php_cv_bison_version=invalid
1717
if test -n "$bison_version_vars"; then
1818
set $bison_version_vars

Zend/tests/bug65911.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #65911 (scope resolution operator - strange behavior with $this)
3+
--FILE--
4+
<?php
5+
class A {}
6+
7+
class B
8+
{
9+
public function go()
10+
{
11+
$this->foo = 'bar';
12+
echo A::$this->foo; // should not output 'bar'
13+
}
14+
}
15+
16+
$obj = new B();
17+
$obj->go();
18+
?>
19+
--EXPECTF--
20+
Fatal error: Access to undeclared static property: A::$this in %s on line %d

Zend/zend_builtin_functions.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,17 @@ ZEND_FUNCTION(func_get_args)
461461

462462
array_init_size(return_value, arg_count);
463463
for (i=0; i<arg_count; i++) {
464-
zval *element;
464+
zval *element, *arg;
465465

466-
ALLOC_ZVAL(element);
467-
*element = **((zval **) (p-(arg_count-i)));
468-
zval_copy_ctor(element);
469-
INIT_PZVAL(element);
466+
arg = *((zval **) (p-(arg_count-i)));
467+
if (!Z_ISREF_P(arg)) {
468+
element = arg;
469+
Z_ADDREF_P(element);
470+
} else {
471+
ALLOC_ZVAL(element);
472+
INIT_PZVAL_COPY(element, arg);
473+
zval_copy_ctor(element);
474+
}
470475
zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL);
471476
}
472477
}

Zend/zend_compile.c

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC) /* {{{ */
908908
{
909909
if ((opline->opcode == ZEND_FETCH_W) && (opline->op1_type == IS_CONST)
910910
&& (Z_TYPE(CONSTANT(opline->op1.constant)) == IS_STRING)
911+
&& ((opline->extended_value & ZEND_FETCH_STATIC_MEMBER) != ZEND_FETCH_STATIC_MEMBER)
911912
&& (Z_HASH_P(&CONSTANT(opline->op1.constant)) == THIS_HASHVAL)
912913
&& (Z_STRLEN(CONSTANT(opline->op1.constant)) == (sizeof("this")-1))
913914
&& !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this"))) {
@@ -1749,7 +1750,6 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
17491750
zend_op dummy_opline;
17501751

17511752
dummy_opline.result_type = IS_UNUSED;
1752-
dummy_opline.op1_type = IS_UNUSED;
17531753

17541754
zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op));
17551755
}
@@ -2662,7 +2662,7 @@ static int generate_free_switch_expr(const zend_switch_entry *switch_entry TSRML
26622662
opline->opcode = (switch_entry->cond.op_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
26632663
SET_NODE(opline->op1, &switch_entry->cond);
26642664
SET_UNUSED(opline->op2);
2665-
opline->extended_value = 0;
2665+
26662666
return 0;
26672667
}
26682668
/* }}} */
@@ -2672,7 +2672,7 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /*
26722672
zend_op *opline;
26732673

26742674
/* If we reach the separator then stop applying the stack */
2675-
if (foreach_copy->result_type == IS_UNUSED && foreach_copy->op1_type == IS_UNUSED) {
2675+
if (foreach_copy->result_type == IS_UNUSED) {
26762676
return 1;
26772677
}
26782678

@@ -2681,16 +2681,6 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /*
26812681
opline->opcode = (foreach_copy->result_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
26822682
COPY_NODE(opline->op1, foreach_copy->result);
26832683
SET_UNUSED(opline->op2);
2684-
opline->extended_value = 1;
2685-
2686-
if (foreach_copy->op1_type != IS_UNUSED) {
2687-
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
2688-
2689-
opline->opcode = (foreach_copy->op1_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
2690-
COPY_NODE(opline->op1, foreach_copy->op1);
2691-
SET_UNUSED(opline->op2);
2692-
opline->extended_value = 0;
2693-
}
26942684

26952685
return 0;
26962686
}
@@ -6227,7 +6217,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
62276217
{
62286218
zend_op *opline;
62296219
zend_bool is_variable;
6230-
zend_bool push_container = 0;
62316220
zend_op dummy_opline;
62326221

62336222
if (variable) {
@@ -6239,14 +6228,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
62396228
/* save the location of FETCH_W instruction(s) */
62406229
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
62416230
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
6242-
if (CG(active_op_array)->last > 0 &&
6243-
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) {
6244-
/* Only lock the container if we are fetching from a real container and not $this */
6245-
if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].op1_type == IS_VAR) {
6246-
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].extended_value |= ZEND_FETCH_ADD_LOCK;
6247-
push_container = 1;
6248-
}
6249-
}
62506231
} else {
62516232
is_variable = 0;
62526233
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
@@ -6266,11 +6247,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
62666247
opline->extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0;
62676248

62686249
COPY_NODE(dummy_opline.result, opline->result);
6269-
if (push_container) {
6270-
COPY_NODE(dummy_opline.op1, CG(active_op_array)->opcodes[CG(active_op_array)->last-2].op1);
6271-
} else {
6272-
dummy_opline.op1_type = IS_UNUSED;
6273-
}
62746250
zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op));
62756251

62766252
/* save the location of FE_FETCH */
@@ -6327,7 +6303,6 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
63276303
opline->extended_value |= ZEND_FE_FETCH_BYREF;
63286304
CG(active_op_array)->opcodes[foreach_token->u.op.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE;
63296305
} else {
6330-
zend_op *foreach_copy;
63316306
zend_op *fetch = &CG(active_op_array)->opcodes[foreach_token->u.op.opline_num];
63326307
zend_op *end = &CG(active_op_array)->opcodes[open_brackets_token->u.op.opline_num];
63336308

@@ -6344,9 +6319,6 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
63446319
fetch->opcode -= 3; /* FETCH_W -> FETCH_R */
63456320
}
63466321
}
6347-
/* prevent double SWITCH_FREE */
6348-
zend_stack_top(&CG(foreach_copy_stack), (void **) &foreach_copy);
6349-
foreach_copy->op1_type = IS_UNUSED;
63506322
}
63516323

63526324
GET_NODE(&value_node, opline->result);

0 commit comments

Comments
 (0)