Skip to content

Commit 61bee02

Browse files
committed
Merge branch 'master' of git.php.net:/php-src
2 parents 7101e91 + 9b2303a commit 61bee02

File tree

295 files changed

+12612
-4788
lines changed

Some content is hidden

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

295 files changed

+12612
-4788
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

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ PHP NEWS
33
?? ??? 201?, PHP 5.5.0
44

55
- General improvements:
6+
. Add generators and coroutines (https://wiki.php.net/rfc/generators).
7+
(Nikita Popov)
8+
. Support list in foreach (https://wiki.php.net/rfc/foreachlist). (Laruence)
69
. Implemented 'finally' keyword (https://wiki.php.net/rfc/finally). (Laruence)
710
. Drop Windows XP and 2003 support. (Pierre)
811
. Improve set_exception_handler while doing reset.(Laruence)
@@ -23,6 +26,10 @@ PHP NEWS
2326
(srgoogleguy, Gustavo)
2427
. Implemented FR #60738 (Allow 'set_error_handler' to handle NULL).
2528
(Laruence, Nikita Popov)
29+
. Return previous handler when passing NULL to set_error_handler and
30+
set_exception_handler. (Nikita Popov)
31+
. Added optional second argument for assert() to specify custom message. Patch
32+
by Lonny Kapelushnik ([email protected]). (Lars)
2633

2734
- cURL:
2835
. Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,

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

UPGRADING

+8
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ PHP X.Y UPGRADE NOTES
3131
2. New Features
3232
========================================
3333

34+
- Support list in foreach. (Laruence)
35+
(wiki.php.net/rfc/foreachlist)
3436
- Support finally keyword. (Laruence)
3537
(wiki.php.net/rfc/finally)
3638
- Support constant array/string dereferencing. (Laruence)
3739
(https://wiki.php.net/rfc/constdereference)
3840
- Add support for using empty() on the result of function calls and
3941
other expressions. Thus it is now possible to write empty(getArray()),
4042
for example. (https://wiki.php.net/rfc/empty_isset_exprs)
43+
- Added generators.
44+
(https://wiki.php.net/rfc/generators)
4145

4246
========================================
4347
2. Changes in SAPI modules
@@ -103,6 +107,10 @@ PHP X.Y UPGRADE NOTES
103107
but that predated the existence of E_DEPRECATED.
104108
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
105109
zend_logo_guid() have been removed
110+
- set_error_handler(NULL) can now be used to reset the error handler.
111+
Furthermore both set_error_handler(NULL) and set_exception_handler(NULL) will
112+
now return the previously defined error/exception handler. Previously
113+
bool(true) was returned.
106114

107115
========================================
108116
5. New Functions

Zend/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ libZend_la_SOURCES=\
1717
zend_objects_API.c zend_ts_hash.c zend_stream.c \
1818
zend_default_classes.c \
1919
zend_iterators.c zend_interfaces.c zend_exceptions.c \
20-
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c
20+
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \
21+
zend_generators.c
2122

2223
libZend_la_LDFLAGS =
2324
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@

Zend/Zend.dsp

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Zend/ZendTS.dsp

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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/bug60738.phpt

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ Bug #60738 Allow 'set_error_handler' to handle NULL
33
--FILE--
44
<?php
55

6-
set_error_handler(function() { echo 'Intercepted error!', "\n"; });
6+
var_dump(set_error_handler(
7+
function() { echo 'Intercepted error!', "\n"; }
8+
));
79

810
trigger_error('Error!');
911

10-
set_error_handler(null);
12+
var_dump(set_error_handler(null));
1113

1214
trigger_error('Error!');
1315
?>
1416
--EXPECTF--
17+
NULL
1518
Intercepted error!
19+
object(Closure)#1 (0) {
20+
}
1621

1722
Notice: Error! in %s on line %d

Zend/tests/bug60738_variation.phpt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Bug #60738 Allow 'set_error_handler' to handle NULL
3+
--FILE--
4+
<?php
5+
6+
var_dump(set_exception_handler(
7+
function() { echo 'Intercepted exception!', "\n"; }
8+
));
9+
10+
var_dump(set_exception_handler(null));
11+
12+
throw new Exception('Exception!');
13+
?>
14+
--EXPECTF--
15+
NULL
16+
object(Closure)#1 (0) {
17+
}
18+
19+
Fatal error: Uncaught exception 'Exception' with message 'Exception!' in %s:%d
20+
Stack trace:
21+
#0 {main}
22+
thrown in %s on line %d
23+

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)