Commit b57a2691 authored by Ondrej Sury's avatar Ondrej Sury

Imported Upstream version 5.4.8

parent 45c0aa44
define set_ts
set $tsrm_ls = $arg0
end
document set_ts
set the ts resource, it is impossible for gdb to
call ts_resource_ex while no process is running,
but we could get the resource from the argument
of frame info.
end
define ____executor_globals
if basic_functions_module.zts
set $tsrm_ls = ts_resource_ex(0, 0)
if !$tsrm_ls
set $tsrm_ls = ts_resource_ex(0, 0)
end
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
else
......@@ -38,12 +51,53 @@ define dump_bt
set $t = $arg0
while $t
printf "[%p] ", $t
if $t->function_state.function->common.function_name
if $t->function_state.arguments
set $count = (int)*($t->function_state.arguments)
printf "%s(", $t->function_state.function->common.function_name
set $fst = $t->function_state
if $fst.function->common.function_name
if $fst.arguments
set $count = (int)*($fst.arguments)
if $t->object
if $fst.function.common.scope
printf "%s->", $fst.function.common.scope->name
else
if !$eg
____executor_globals
end
set $known_class = 0
if $eg
set $handle = $t->object.value.obj.handle
set $handlers = $t->object.value.obj.handlers
set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object
if $handlers->get_class_entry == &zend_std_object_get_class
set $known_class = 1
if $handlers.get_class_name
if $handlers.get_class_name != &zend_std_object_get_class_name
set $known_class = 0
end
end
if $known_class
printf "%s->", $zobj->ce.name
end
end
end
if !$known_class
printf "(Unknown)->"
end
end
else
if $fst.function.common.scope
printf "%s::", $fst.function.common.scope->name
end
end
printf "%s(", $fst.function->common.function_name
while $count > 0
set $zvalue = *(zval **)($t->function_state.arguments - $count)
set $zvalue = *(zval **)($fst.arguments - $count)
set $type = $zvalue->type
if $type == 0
printf "NULL"
......@@ -73,7 +127,7 @@ define dump_bt
if $type == 7
printf "resource(#%d)", $zvalue->value.lval
end
if $type == 8
if $type == 8
printf "constant"
end
if $type == 9
......@@ -89,7 +143,7 @@ define dump_bt
end
printf ") "
else
printf "%s() ", $t->function_state.function->common.function_name
printf "%s() ", $fst.function->common.function_name
end
else
printf "??? "
......@@ -600,7 +654,7 @@ define zmemcheck
end
end
if $not_found
printf "no such block that begins at %p.\n", $aptr
printf "no such block that begins at %p.\n", $aptr
end
if $arg0 == 0
printf "-------------------------------------------------------------------------------\n"
......
......@@ -15,6 +15,7 @@ ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
ext/filter/filter.c ident
ext/zip/php_zip.c ident
README.input_filter ident
run-tests.php ident
sapi/nsapi/nsapi.c ident
......
......@@ -2,11 +2,11 @@
PHP Coding Standards
========================
This file lists several standards that any programmer, adding or changing
code in PHP, should follow. Since this file was added at a very late
This file lists several standards that any programmer adding or changing
code in PHP should follow. Since this file was added at a very late
stage of the development of PHP v3.0, the code base does not (yet) fully
follow it, but it's going in that general direction. Since we are now
well into the version 4 releases, many sections have been recoded to use
well into version 5 releases, many sections have been recoded to use
these rules.
Code Implementation
......
This diff is collapsed.
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 Oct 2012, PHP 5.4.8
- CLI server:
. Changed response to unknown HTTP method to 501 according to RFC.
(Niklas Lindgren).
. Support HTTP PATCH method. Patch by Niklas Lindgren, GitHub PR #190.
(Lars)
- Core:
. Added optional second argument for assert() to specify custom message. Patch
by Lonny Kapelushnik (lonny@lonnylot.com). (Lars)
. Support building PHP with the native client toolchain. (Stuart Langley)
. Added --offline option for tests. (Remi)
. Fixed bug #63162 (parse_url does not match password component). (husman)
. Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry)
. Fixed bug #63093 (Segfault while load extension failed in zts-build).
(Laruence)
. Fixed bug #62976 (Notice: could not be converted to int when comparing
some builtin classes). (Laruence)
. Fixed bug #62955 (Only one directive is loaded from "Per Directory Values"
Windows registry). (aserbulov at parallels dot com)
. Fixed bug #62907 (Double free when use traits). (Dmitry)
. Fixed bug #61767 (Shutdown functions not called in certain error
situation). (Dmitry)
. Fixed bug #60909 (custom error handler throwing Exception + fatal error
= no shutdown function). (Dmitry)
. Fixed bug #60723 (error_log error time has changed to UTC ignoring default
timezone). (Laruence)
- cURL:
. Fixed bug #62085 (file_get_contents a remote file by Curl wrapper will
cause cpu Soaring). (Pierrick)
- Date:
. Fixed bug #62896 ("DateTime->modify('+0 days')" modifies DateTime object)
(Lonny Kapelushnik)
. Fixed bug #62561 (DateTime add 'P1D' adds 25 hours). (Lonny Kapelushnik)
- DOM:
. Fixed bug #63015 (Incorrect arginfo for DOMErrorHandler). (Rob)
- FPM:
. Fixed bug #62954 (startup problems fpm / php-fpm). (fat)
. Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat)
. Fixed bug #63085 (Systemd integration and daemonize). (remi, fat)
. Fixed bug #62947 (Unneccesary warnings on FPM). (fat)
. Fixed bug #62887 (Only /status?plain&full gives "last request cpu"). (fat)
. Fixed bug #62216 (Add PID to php-fpm init.d script). (fat)
- OpenSSL:
. Implemented FR #61421 (OpenSSL signature verification missing RMD160,
SHA224, SHA256, SHA384, SHA512). (Mark Jones)
- SOAP
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
(Dmitry)
- SPL:
. Bug #62987 (Assigning to ArrayObject[null][something] overrides all
undefined variables). (Laruence)
- mbstring:
. Allow passing null as a default value to mb_substr() and mb_strcut(). Patch
by Alexander Moskaliov via GitHub PR #133. (Lars)
- Filter extension:
. Bug #49510: Boolean validation fails with FILTER_NULL_ON_FAILURE with empty
string or false. (Lars)
- Sockets
. Fixed bug #63000 (MCAST_JOIN_GROUP on OSX is broken, merge of PR 185 by
Igor Wiedler). (Lars)
13 Sep 2012, PHP 5.4.7
- Core:
. Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
. Fixed bug #62844 (parse_url() does not recognize //). (Andrew Faulds).
. Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not
set). (Felipe)
. Fixed bug #62763 (register_shutdown_function and extending class).
(Laruence)
. Fixed bug #62725 (Calling exit() in a shutdown function does not return
the exit value). (Laruence)
. Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence)
. Fixed bug #62716 (munmap() is called with the incorrect length).
(slangley@google.com)
. Fixed bug #62358 (Segfault when using traits a lot). (Laruence)
. Fixed bug #62328 (implementing __toString and a cast to string fails)
(Laruence)
. Fixed bug #51363 (Fatal error raised by var_export() not caught by error
handler). (Lonny Kapelushnik)
. Fixed bug #40459 (Stat and Dir stream wrapper methods do not call
constructor). (Stas)
- CURL:
. Fixed bug #62912 (CURLINFO_PRIMARY_* AND CURLINFO_LOCAL_* not exposed).
(Pierrick)
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
- Intl:
. Fixed Spoofchecker not being registered on ICU 49.1. (Gustavo)
. Fix bug #62933 (ext/intl compilation error on icu 3.4.1). (Gustavo)
. Fix bug #62915 (defective cloning in several intl classes). (Gustavo)
- Installation:
. Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia)
- PCRE:
. Fixed bug #55856 (preg_replace should fail on trailing garbage).
(reg dot php at alf dot nu)
- PDO:
. Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
- Reflection:
. Fixed bug #62892 (ReflectionClass::getTraitAliases crashes on importing
trait methods as private). (Felipe)
. Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong
result). (Laruence)
- Session:
. Fixed bug (segfault due to retval is not initialized). (Laruence)
. Fixed bug (segfault due to PS(mod_user_implemented) not be reseted
when close handler call exit). (Laruence)
- SOAP
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
(Dmitry)
- SPL:
. Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray)
(Laruence)
. Implemented FR #62840 (Add sort flag to ArrayObject::ksort). (Laruence)
- Standard:
. Fixed bug #62836 (Seg fault or broken object references on unserialize()).
(Laruence)
- FPM:
. Merged PR 121 by minitux to add support for slow request counting on PHP
FPM status page. (Lars)
16 Aug 2012, PHP 5.4.6
- CLI Server:
......@@ -133,7 +276,7 @@ PHP NEWS
- Sockets:
. Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
- SPL:
. Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to
dot files). (Laruence)
......
......@@ -127,33 +127,34 @@ Rolling a stable release
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
3. **Merge** all related sections in NEWS (f.e. merge the 4.4.1RC1 and 4.4.0 sections)
3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections)
4. Commit those changes
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
6. tag the repository with the version f.e. "``cvs tag php_4_4_1``"
6. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
(of course, you need to change that to the version you're rolling an RC for).
When making 5.X release, you need to tag the Zend directory separately!!
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless if we get
was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
8. Commit those changes
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
branch if you're rolling 4.4.x releases).
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4
branch if you're rolling 5.5.x releases).
10. You do not have to update the tree, but of course you can with "``cvs up -dP``".
10. You do not have to update the tree, but of course you can with "``git pull
origin <branch>``".
11. run: ``./makedist php 4.4.1``, this will export the tree, create configure
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
and build two tarballs (one gz and one bz2).
12. Commit those two tarballs to CVS (phpweb/distributions)
12. Commit those two tarballs to Git (php-distributions.git)
13. Once the release has been tagged, contact the PHP Windows development team
(internals-win@lists.php.net) so that Windows binaries can be created. Once
......@@ -171,6 +172,9 @@ Getting the stable release announced
a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4)
b. In case multiple PHP minor versions are in active development you have
to manually copy the old information to include/releases.inc
2. Edit ``phpweb/include/version.inc`` and change (X=major release number):
a. ``$PHP_X_VERSION`` to the correct version
......@@ -187,7 +191,7 @@ Getting the stable release announced
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
3. Update the ChangeLog file for the given major version
f.e. ``ChangeLog-4.php`` from the NEWS file
f.e. ``ChangeLog-5.php`` from the NEWS file
a. go over the list and put every element on one line
......@@ -207,9 +211,9 @@ f.e. ``ChangeLog-4.php`` from the NEWS file
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
4. ``cp releases/4_4_0.php releases/4_4_1.php``
4. ``cp releases/5_4_0.php releases/5_4_1.php``
5. ``cvs add releases/4_4_1.php``
5. ``git add releases/5_4_1.php``
6. Update the ``releases/*.php`` file with relevant data. The release
announcement file should list in detail:
......@@ -232,17 +236,6 @@ to upgrade.
php-general@lists.php.net and internals@lists.php.net with a text similar to
http://news.php.net/php.internals/17222.
10. Update ``php-bugs-web/include/functions.php`` to include the new version
number, and remove the RC from there.
11. Update ``qaweb/include/release-qa.php``
- Update $QA_RELEASES with the appropriate information, which means bumping
the version number to an upcoming version.
Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version,
so replace 5.3.7 with 5.3.8 within $QA_RELEASES.
Re-releasing the same version (or -pl)
--------------------------------------
......
......@@ -347,6 +347,9 @@ PHP 5.4 UPGRADE NOTES
allows for toggling if the list of namespaces starts from the document root
or from the node you call the method on
- Since 5.4.7, ctor is always called when new user stream wrapper object is created.
Before, it was called only when stream_open was called.
==============================
5. Changes to existing classes
==============================
......
......@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5"
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
......
......@@ -13,4 +13,10 @@ function eh()
set_error_handler("eh");
$a = $empty($b);
--EXPECTF--
Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4
Stack trace:
#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array)
#1 {main}
thrown in %sbug51394.php on line 4
Fatal error: Function name must be a string in %sbug51394.php on line 9
\ No newline at end of file
--TEST--
Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
--FILE--
<?php
register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
set_error_handler(function($errno, $errstr, $errfile, $errline){
echo "error($errstr)";
throw new Exception("Foo");
});
require 'notfound.php';
--EXPECTF--
error(require(notfound.php): failed to open stream: No such file or directory)
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
Stack trace:
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
#1 %sbug60909_1.php(8): require()
#2 {main}
thrown in %sbug60909_1.php on line 5
Fatal error: main(): Failed opening required 'notfound.php' (include_path='%s') in %sbug60909_1.php on line 8
!!!shutdown!!!
--TEST--
Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
--FILE--
<?php
register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
set_error_handler(function($errno, $errstr, $errfile, $errline){throw new Exception("Foo");});
class Bad {
public function __toString() {
throw new Exception('Oops, I cannot do this');
}
}
$bad = new Bad();
echo "$bad";
--EXPECTF--
Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
!!!shutdown!!!
......@@ -14,5 +14,6 @@ class B extends A
}
?>
==DONE==
--EXPECTF--
Strict Standards: Declaration of B::test() should be compatible with A::test($a) in %sbug61761.php on line %d
==DONE==
--TEST--
Bug #61767 (Shutdown functions not called in certain error situation)
--FILE--
<?php
set_error_handler(function($code, $msg, $file = null, $line = null) {
echo "Error handler called ($msg)\n";
throw new \ErrorException($msg, $code, 0, $file, $line);
});
register_shutdown_function(function(){
echo "Shutting down\n";
print_r(error_get_last());
});
//$undefined = null; // defined variable does not cause problems
$undefined->foo();
--EXPECTF--
Error handler called (Undefined variable: undefined)
Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13
Stack trace:
#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array)
#1 {main}
thrown in %sbug61767.php on line 13
Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13
Shutting down
Array
(
[type] => 1
[message] => Call to a member function foo() on a non-object
[file] => %sbug61767.php
[line] => 13
)
--TEST--
Bug #62358 (Segfault when using traits a lot)
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") !== "0") {
die("skip Need Zend MM enabled");
}
?>
--FILE--
<?php
trait T {
public function foo() {
echo "from T";
}
}
interface I {
public function foo();
}
abstract class A implements I{
use T;
}
class B extends A {
public function foo($var) {
}
}
?>
--EXPECTF--
Strict Standards: Declaration of B::foo() should be compatible with A::foo() in %sbug62358.php on line %d
--TEST--
Bug #62763 (register_shutdown_function and extending class)
--FILE--
<?php
class test1 {
public function __construct() {
register_shutdown_function(array($this, 'shutdown'));
}
public function shutdown() {
exit(__METHOD__);
}
}
class test2 extends test1 {
public function __destruct() {
exit (__METHOD__);
}
}
new test1;
new test2;
?>
--EXPECT--
test1::shutdowntest2::__destruct
--TEST--
Bug #62892 (ReflectionClass::getTraitAliases crashes on importing trait methods as private)
--FILE--
<?php
trait myTrait {
public function run() {}
}
class myClass {
use myTrait {
MyTrait::run as private;
}
}
$class = new \ReflectionClass('myClass');
var_dump($class->getTraitAliases());
?>
--EXPECTF--
array(0) {
}
--TEST--
Bug #62907 (Double free when use traits)
--FILE--
<?php
function __autoload($name) {
if ($name == "B") {
eval ("abstract class B extends A { }");
} else if ($name == "A") {
eval ("abstract class A { use T { T::__construct as __asconstruct; }}");
} else if ($name == "T") {
eval ("trait T { public function __construct() { } }");
}
return TRUE;
}
class C extends B {
public function __construct() {
}
}
echo "okey";
--EXPECT--
okey
--TEST--
Bug #62956: "incompatible" signatures for private methods should not cause E_STRICT
--FILE--
<?php
class Base
{
private function test()
{}
}
class Extension extends Base
{
private function test($arg)
{}
}
?>
==DONE==
--EXPECT--
==DONE==
--TEST--
Bug #63111 (is_callable() lies for abstract static method)
--FILE--
<?php
abstract class Foo {
abstract static function bar();
}
interface MyInterface {
static function bar();
}
abstract class Bar {
static function foo() {
echo "ok\n";
}
}
var_dump(is_callable(array("Foo", "bar")));
var_dump(is_callable("Foo::bar"));
var_dump(is_callable(array("MyInterface", "bar")));