Skip to content

Commit 34eb787

Browse files
committed
Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4
2 parents ab62ffa + 9e3396b commit 34eb787

File tree

171 files changed

+2054
-892
lines changed

Some content is hidden

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

171 files changed

+2054
-892
lines changed

.gdbinit

+63-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
define set_ts
2+
set $tsrm_ls = $arg0
3+
end
4+
5+
document set_ts
6+
set the ts resource, it is impossible for gdb to
7+
call ts_resource_ex while no process is running,
8+
but we could get the resource from the argument
9+
of frame info.
10+
end
11+
112
define ____executor_globals
213
if basic_functions_module.zts
3-
set $tsrm_ls = ts_resource_ex(0, 0)
14+
if !$tsrm_ls
15+
set $tsrm_ls = ts_resource_ex(0, 0)
16+
end
417
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
518
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
619
else
@@ -38,12 +51,53 @@ define dump_bt
3851
set $t = $arg0
3952
while $t
4053
printf "[%p] ", $t
41-
if $t->function_state.function->common.function_name
42-
if $t->function_state.arguments
43-
set $count = (int)*($t->function_state.arguments)
44-
printf "%s(", $t->function_state.function->common.function_name
54+
set $fst = $t->function_state
55+
if $fst.function->common.function_name
56+
if $fst.arguments
57+
set $count = (int)*($fst.arguments)
58+
59+
if $t->object
60+
if $fst.function.common.scope
61+
printf "%s->", $fst.function.common.scope->name
62+
else
63+
if !$eg
64+
____executor_globals
65+
end
66+
67+
set $known_class = 0
68+
if $eg
69+
set $handle = $t->object.value.obj.handle
70+
set $handlers = $t->object.value.obj.handlers
71+
set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object
72+
73+
if $handlers->get_class_entry == &zend_std_object_get_class
74+
set $known_class = 1
75+
76+
if $handlers.get_class_name
77+
if $handlers.get_class_name != &zend_std_object_get_class_name
78+
set $known_class = 0
79+
end
80+
end
81+
82+
if $known_class
83+
printf "%s->", $zobj->ce.name
84+
end
85+
end
86+
end
87+
88+
if !$known_class
89+
printf "(Unknown)->"
90+
end
91+
end
92+
else
93+
if $fst.function.common.scope
94+
printf "%s::", $fst.function.common.scope->name
95+
end
96+
end
97+
98+
printf "%s(", $fst.function->common.function_name
4599
while $count > 0
46-
set $zvalue = *(zval **)($t->function_state.arguments - $count)
100+
set $zvalue = *(zval **)($fst.arguments - $count)
47101
set $type = $zvalue->type
48102
if $type == 0
49103
printf "NULL"
@@ -73,7 +127,7 @@ define dump_bt
73127
if $type == 7
74128
printf "resource(#%d)", $zvalue->value.lval
75129
end
76-
if $type == 8
130+
if $type == 8
77131
printf "constant"
78132
end
79133
if $type == 9
@@ -89,7 +143,7 @@ define dump_bt
89143
end
90144
printf ") "
91145
else
92-
printf "%s() ", $t->function_state.function->common.function_name
146+
printf "%s() ", $fst.function->common.function_name
93147
end
94148
else
95149
printf "??? "
@@ -600,7 +654,7 @@ define zmemcheck
600654
end
601655
end
602656
if $not_found
603-
printf "no such block that begins at %p.\n", $aptr
657+
printf "no such block that begins at %p.\n", $aptr
604658
end
605659
if $arg0 == 0
606660
printf "-------------------------------------------------------------------------------\n"

CODING_STANDARDS

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
PHP Coding Standards
33
========================
44

5-
This file lists several standards that any programmer, adding or changing
6-
code in PHP, should follow. Since this file was added at a very late
5+
This file lists several standards that any programmer adding or changing
6+
code in PHP should follow. Since this file was added at a very late
77
stage of the development of PHP v3.0, the code base does not (yet) fully
88
follow it, but it's going in that general direction. Since we are now
9-
well into the version 4 releases, many sections have been recoded to use
9+
well into version 5 releases, many sections have been recoded to use
1010
these rules.
1111

1212
Code Implementation

NEWS

+95-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,84 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? 2012, PHP 5.4.7
3+
?? ??? 2012, PHP 5.4.9
4+
5+
?? ??? 2012, PHP 5.4.8
6+
7+
- CLI server:
8+
. Changed response to unknown HTTP method to 501 according to RFC.
9+
(Niklas Lindgren).
10+
. Support HTTP PATCH method. Patch by Niklas Lindgren, GitHub PR #190.
11+
(Lars)
12+
13+
- Core:
14+
. Added optional second argument for assert() to specify custom message. Patch
15+
by Lonny Kapelushnik ([email protected]). (Lars)
16+
. Support building PHP with the native client toolchain. (Stuart Langley)
17+
. Added --offline option for tests. (Remi)
18+
. Fixed bug #63162 (parse_url does not match password component). (husman)
19+
. Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry)
20+
. Fixed bug #63093 (Segfault while load extension failed in zts-build).
21+
(Laruence)
22+
. Fixed bug #62976 (Notice: could not be converted to int when comparing
23+
some builtin classes). (Laruence)
24+
. Fixed bug #62955 (Only one directive is loaded from "Per Directory Values"
25+
Windows registry). (aserbulov at parallels dot com)
26+
. Fixed bug #62907 (Double free when use traits). (Dmitry)
27+
. Fixed bug #61767 (Shutdown functions not called in certain error
28+
situation). (Dmitry)
29+
. Fixed bug #60909 (custom error handler throwing Exception + fatal error
30+
= no shutdown function). (Dmitry)
31+
. Fixed bug #60723 (error_log error time has changed to UTC ignoring default
32+
timezone). (Laruence)
33+
34+
- cURL:
35+
. Fixed bug #62085 (file_get_contents a remote file by Curl wrapper will
36+
cause cpu Soaring). (Pierrick)
37+
38+
- Date:
39+
. Fixed bug #62896 ("DateTime->modify('+0 days')" modifies DateTime object)
40+
(Lonny Kapelushnik)
41+
. Fixed bug #62561 (DateTime add 'P1D' adds 25 hours). (Lonny Kapelushnik)
42+
43+
- DOM:
44+
. Fixed bug #63015 (Incorrect arginfo for DOMErrorHandler). (Rob)
45+
46+
- FPM:
47+
. Fixed bug #62954 (startup problems fpm / php-fpm). (fat)
48+
. Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat)
49+
. Fixed bug #63085 (Systemd integration and daemonize). (remi, fat)
50+
. Fixed bug #62947 (Unneccesary warnings on FPM). (fat)
51+
. Fixed bug #62887 (Only /status?plain&full gives "last request cpu"). (fat)
52+
. Fixed bug #62216 (Add PID to php-fpm init.d script). (fat)
53+
54+
- OpenSSL:
55+
. Implemented FR #61421 (OpenSSL signature verification missing RMD160,
56+
SHA224, SHA256, SHA384, SHA512). (Mark Jones)
57+
58+
- SOAP
59+
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
60+
(Dmitry)
61+
62+
- SPL:
63+
. Bug #62987 (Assigning to ArrayObject[null][something] overrides all
64+
undefined variables). (Laruence)
65+
66+
- mbstring:
67+
. Allow passing null as a default value to mb_substr() and mb_strcut(). Patch
68+
by Alexander Moskaliov via GitHub PR #133. (Lars)
69+
70+
- Filter extension:
71+
. Bug #49510: Boolean validation fails with FILTER_NULL_ON_FAILURE with empty
72+
string or false. (Lars)
73+
74+
- Sockets
75+
. Fixed bug #63000 (MCAST_JOIN_GROUP on OSX is broken, merge of PR 185 by
76+
Igor Wiedler). (Lars)
77+
78+
13 Sep 2012, PHP 5.4.7
479

580
- Core:
81+
. Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
682
. Fixed bug #62844 (parse_url() does not recognize //). (Andrew Faulds).
783
. Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not
884
set). (Felipe)
@@ -22,15 +98,22 @@ PHP NEWS
2298
constructor). (Stas)
2399

24100
- CURL:
101+
. Fixed bug #62912 (CURLINFO_PRIMARY_* AND CURLINFO_LOCAL_* not exposed).
102+
(Pierrick)
25103
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
26104

27-
- DateTime:
28-
. Fixed bug #62852 (Unserialize invalid DateTime causes crash).
29-
105+
- Intl:
106+
. Fixed Spoofchecker not being registered on ICU 49.1. (Gustavo)
107+
. Fix bug #62933 (ext/intl compilation error on icu 3.4.1). (Gustavo)
108+
. Fix bug #62915 (defective cloning in several intl classes). (Gustavo)
30109

31110
- Installation:
32111
. Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia)
33112

113+
- PCRE:
114+
. Fixed bug #55856 (preg_replace should fail on trailing garbage).
115+
(reg dot php at alf dot nu)
116+
34117
- PDO:
35118
. Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
36119

@@ -45,6 +128,10 @@ PHP NEWS
45128
. Fixed bug (segfault due to PS(mod_user_implemented) not be reseted
46129
when close handler call exit). (Laruence)
47130

131+
- SOAP
132+
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
133+
(Dmitry)
134+
48135
- SPL:
49136
. Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray)
50137
(Laruence)
@@ -54,6 +141,9 @@ PHP NEWS
54141
. Fixed bug #62836 (Seg fault or broken object references on unserialize()).
55142
(Laruence)
56143

144+
- FPM:
145+
. Merged PR 121 by minitux to add support for slow request counting on PHP
146+
FPM status page. (Lars)
57147

58148
16 Aug 2012, PHP 5.4.6
59149

@@ -188,7 +278,7 @@ PHP NEWS
188278

189279
- Sockets:
190280
. Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
191-
281+
192282
- SPL:
193283
. Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to
194284
dot files). (Laruence)

README.RELEASE_PROCESS

+15-22
Original file line numberDiff line numberDiff line change
@@ -127,33 +127,34 @@ Rolling a stable release
127127

128128
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
129129

130-
3. **Merge** all related sections in NEWS (f.e. merge the 4.4.1RC1 and 4.4.0 sections)
130+
3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections)
131131

132132
4. Commit those changes
133133

134134
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
135135
credits files in ext/standard.
136136

137-
6. tag the repository with the version f.e. "``cvs tag php_4_4_1``"
137+
6. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
138138
(of course, you need to change that to the version you're rolling an RC for).
139139
When making 5.X release, you need to tag the Zend directory separately!!
140140

141141
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
142142
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
143-
was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless if we get
143+
was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get
144144
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
145145

146146
8. Commit those changes
147147

148-
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
149-
branch if you're rolling 4.4.x releases).
148+
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4
149+
branch if you're rolling 5.5.x releases).
150150

151-
10. You do not have to update the tree, but of course you can with "``cvs up -dP``".
151+
10. You do not have to update the tree, but of course you can with "``git pull
152+
origin <branch>``".
152153

153-
11. run: ``./makedist php 4.4.1``, this will export the tree, create configure
154+
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
154155
and build two tarballs (one gz and one bz2).
155156

156-
12. Commit those two tarballs to CVS (phpweb/distributions)
157+
12. Commit those two tarballs to Git (php-distributions.git)
157158

158159
13. Once the release has been tagged, contact the PHP Windows development team
159160
([email protected]) so that Windows binaries can be created. Once
@@ -171,6 +172,9 @@ Getting the stable release announced
171172

172173
a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4)
173174

175+
b. In case multiple PHP minor versions are in active development you have
176+
to manually copy the old information to include/releases.inc
177+
174178
2. Edit ``phpweb/include/version.inc`` and change (X=major release number):
175179

176180
a. ``$PHP_X_VERSION`` to the correct version
@@ -187,7 +191,7 @@ Getting the stable release announced
187191
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
188192

189193
3. Update the ChangeLog file for the given major version
190-
f.e. ``ChangeLog-4.php`` from the NEWS file
194+
f.e. ``ChangeLog-5.php`` from the NEWS file
191195

192196
a. go over the list and put every element on one line
193197

@@ -207,9 +211,9 @@ f.e. ``ChangeLog-4.php`` from the NEWS file
207211

208212
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
209213

210-
4. ``cp releases/4_4_0.php releases/4_4_1.php``
214+
4. ``cp releases/5_4_0.php releases/5_4_1.php``
211215

212-
5. ``cvs add releases/4_4_1.php``
216+
5. ``git add releases/5_4_1.php``
213217

214218
6. Update the ``releases/*.php`` file with relevant data. The release
215219
announcement file should list in detail:
@@ -232,17 +236,6 @@ to upgrade.
232236
[email protected] and [email protected] with a text similar to
233237
http://news.php.net/php.internals/17222.
234238

235-
10. Update ``php-bugs-web/include/functions.php`` to include the new version
236-
number, and remove the RC from there.
237-
238-
11. Update ``qaweb/include/release-qa.php``
239-
240-
- Update $QA_RELEASES with the appropriate information, which means bumping
241-
the version number to an upcoming version.
242-
243-
Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version,
244-
so replace 5.3.7 with 5.3.8 within $QA_RELEASES.
245-
246239
Re-releasing the same version (or -pl)
247240
--------------------------------------
248241

Zend/tests/bug51394.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ function eh()
1313
set_error_handler("eh");
1414
$a = $empty($b);
1515
--EXPECTF--
16+
Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4
17+
Stack trace:
18+
#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array)
19+
#1 {main}
20+
thrown in %sbug51394.php on line 4
21+
1622
Fatal error: Function name must be a string in %sbug51394.php on line 9

Zend/tests/bug60909_1.phpt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
3+
--FILE--
4+
<?php
5+
register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
6+
set_error_handler(function($errno, $errstr, $errfile, $errline){
7+
echo "error($errstr)";
8+
throw new Exception("Foo");
9+
});
10+
11+
require 'notfound.php';
12+
--EXPECTF--
13+
error(require(notfound.php): failed to open stream: No such file or directory)
14+
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
15+
Stack trace:
16+
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
17+
#1 %sbug60909_1.php(8): require()
18+
#2 {main}
19+
thrown in %sbug60909_1.php on line 5
20+
21+
Fatal error: main(): Failed opening required 'notfound.php' (include_path='%s') in %sbug60909_1.php on line 8
22+
23+
24+
!!!shutdown!!!

0 commit comments

Comments
 (0)