Commit 706ac641 authored by Ondrej Sury's avatar Ondrej Sury

New upstream version 5.5.0+dfsg

parent e2d52710
This diff is collapsed.
......@@ -43,7 +43,7 @@ See also https://wiki.php.net/rfc/zpp_improv#expose_zend_parse_arg_as_zend_parse
Type specifiers
---------------
The following list shows the type specifier, its meaning and the parameter
types that need to be passed by address. All passed paramaters are set
types that need to be passed by address. All passed parameters are set
if the PHP parameter is non optional and untouched if optional and the
parameter is not present. The only exception is O where the zend_class_entry*
has to be provided on input and is used to verify the PHP parameter is an
......
[IMPORTANT NOTICE]
------------------
Failed tests usualy indicate a problem with your local system setup
Failed tests usually indicate a problem with your local system setup
and not within PHP itself (at least for official PHP release versions).
You may decide to automaticaly submit a test summary to our QA workflow
at the end of a test run.
......
......@@ -385,6 +385,10 @@ PHP 5.5 UPGRADE NOTES
- opcache.preferred_memory_model (default "")
- opcache.protect_memory (default "0")
- opcache.mmap_base (Windows-only)
- If APC or WinCache was used before, the user cache APIs can be replaced by:
- APCu, all supported OSes (http://pecl.php.net/package/APCu, Windows: http://windows.php.net/downloads/pecl/releases/apcu/)
- WinCache, windows only (http://pecl.php.net/package/WinCache), a version with the ability to use only the user
cache will be released shortly after 5.5.0 final
========================================
11. Windows Support
......@@ -392,6 +396,18 @@ PHP 5.5 UPGRADE NOTES
- Apache 2.4 handler is supported as of PHP 5.5.0
- OpCache
Error like 'unable to reattach to base address' could happen in many common setups.
It is due to some technical and design restriction in the engine and cannot be fixed
easily before 5.5.0 final was released.
A possible fix is to tweak the opcache.mmap_base INI setting by forcing the 1st address
to be tried.
For x86 version, the following addreses can be tried:
. 0x20000000, 0x21000000, 0x30000000, 0x31000000, 0x50000000
and for x64 (still expiremental):
. 0x0000100000000000, 0x0000200000000000, 0x0000300000000000, 0x0000700000000000
========================================
12. Other Changes
......
......@@ -435,7 +435,7 @@ Changes in the Zend Engine 2.0
that of other object-oriented languages, such as Java: When the
last reference to an object is destroyed the object's
destructor, which is a class method name __destruct() that
recieves no parameters, is called before the object is freed
receives no parameters, is called before the object is freed
from memory.
Example:
......
......@@ -357,7 +357,7 @@ var_dump($global_var);
test_unset3();
var_dump($global_var);
//Note: No error conditions relating to passing arugments can be tested
//Note: No error conditions relating to passing arguments can be tested
// because these are not functions but statements, it will result in syntax error.
?>
===DONE===
......
--TEST--
Bug #32428 (The @ warning error supression operator is broken)
Bug #32428 (The @ warning error suppression operator is broken)
--FILE--
<?php
$data = @$not_exists;
......
--TEST--
Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
--FILE--
<?php
error_reporting(E_ALL);
set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
function test($func) {
$a = $func("");
return true;
}
class A {
public function b() {
test("strlen");
test("iterator_apply");
}
}
$a = new A();
$a->b();
?>
--EXPECTF--
Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
Stack trace:
#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
#1 %sbug64966.php(6): iterator_apply('')
#2 %sbug64966.php(12): test('iterator_apply')
#3 %sbug64966.php(17): A->b()
#4 {main}
thrown in %sbug64966.php on line 3
--TEST--
Bug #64988 (Class loading order affects E_STRICT warning)
--FILE--
<?php
abstract class Base1 {
public function insert(array $data){
return array_reverse($data);
}
}
class Noisy1 extends Base1 {
public function insert(array $data, $option1 = Null) {
if (!empty($option1)) {
$data['option1'] = $option1;
}
return parent::insert($data);
}
}
class Smooth1 extends Noisy1 {
public function insert(array $data) {
return parent::insert($data, count($data));
}
}
$o = new Smooth1();
echo "okey";
?>
--EXPECTF--
Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
okey
--TEST--
Bug #65051: count() off by one inside unset()
--FILE--
<?php
class Foo {
public $array;
public function __destruct() {
var_dump(count($this->array[0]));
var_dump($this->array[0]);
}
}
$array = [[new Foo]];
$array[0][0]->array =& $array;
unset($array[0][0]);
?>
--EXPECT--
int(0)
array(0) {
}
--TEST--
GC 007: Unreferensed array cycle
GC 007: Unreferenced array cycle
--INI--
zend.enable_gc=1
--FILE--
......
--TEST--
GC 008: Unreferensed object cycle
GC 008: Unreferenced object cycle
--INI--
zend.enable_gc=1
--FILE--
......
--TEST--
GC 009: Unreferensed array-object cycle
GC 009: Unreferenced array-object cycle
--INI--
zend.enable_gc=1
--FILE--
......
......@@ -9,13 +9,13 @@ function recv() {
}
}
$reciever = recv();
var_dump($reciever->current());
$reciever->send(1);
var_dump($reciever->current());
$reciever->send(2);
var_dump($reciever->current());
$reciever->send(3);
$receiver = recv();
var_dump($receiver->current());
$receiver->send(1);
var_dump($receiver->current());
$receiver->send(2);
var_dump($receiver->current());
$receiver->send(3);
?>
--EXPECT--
......
......@@ -1172,7 +1172,7 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
/* This function requires 'properties' to contain all props declared in the
* class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties seperately by
* has protected members then you need to merge the properties separately by
* calling zend_merge_properties(). */
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
{
......
......@@ -465,7 +465,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
*/
ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC);
/** Clear argumens connected with zend_fcall_info *fci
/** Clear arguments connected with zend_fcall_info *fci
* If free_mem is not zero then the params array gets free'd as well
*/
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem);
......@@ -503,7 +503,7 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_l
ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...);
/** Call a function using information created by zend_fcall_info_init()/args().
* If args is given then those replace the arguement info in fci is temporarily.
* If args is given then those replace the argument info in fci is temporarily.
*/
ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
......
......@@ -3464,11 +3464,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC));
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
}
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC);
char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
efree(method_prototype);
}
......@@ -3941,7 +3941,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
#endif
} else {
/* inherited members are overridden by members inserted by traits */
/* check whether the trait method fullfills the inheritance requirements */
/* check whether the trait method fulfills the inheritance requirements */
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
}
}
......@@ -7176,7 +7176,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
}
#elif defined(NETWARE)
/*
* Find the first occurence of : from the left
* Find the first occurrence of : from the left
* move the path pointer to the position just after :
* increment the len_adjust to the length of path till colon character(inclusive)
* If there is no character beyond : simple return len
......
......@@ -106,7 +106,7 @@ typedef struct _zend_gc_globals {
gc_root_buffer *first_unused; /* pointer to first unused buffer */
gc_root_buffer *last_unused; /* pointer to last unused buffer */
zval_gc_info *zval_to_free; /* temporaryt list of zvals to free */
zval_gc_info *zval_to_free; /* temporary list of zvals to free */
zval_gc_info *free_list;
zval_gc_info *next_to_free;
......@@ -199,7 +199,7 @@ static zend_always_inline void gc_remove_from_buffer(gc_root_buffer *root TSRMLS
GC_ZVAL_INIT(z); \
} while (0)
/* The following macroses override macroses from zend_alloc.h */
/* The following macros override macros from zend_alloc.h */
#undef ALLOC_ZVAL
#define ALLOC_ZVAL(z) \
do { \
......
......@@ -527,6 +527,7 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n
if (ht->pInternalPointer == p) {
ht->pInternalPointer = p->pListNext;
}
ht->nNumOfElements--;
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
......@@ -535,7 +536,6 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n
}
pefree(p, ht->persistent);
HANDLE_UNBLOCK_INTERRUPTIONS();
ht->nNumOfElements--;
return SUCCESS;
}
p = p->pNext;
......@@ -1320,6 +1320,7 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
if (ht->pInternalPointer == p) {
ht->pInternalPointer = p->pListNext;
}
ht->nNumOfElements--;
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
......@@ -1327,7 +1328,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
pefree(p->pData, ht->persistent);
}
pefree(p, ht->persistent);
ht->nNumOfElements--;
HANDLE_UNBLOCK_INTERRUPTIONS();
return FAILURE;
}
......@@ -1355,6 +1355,7 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
if (ht->pInternalPointer == q) {
ht->pInternalPointer = q->pListNext;
}
ht->nNumOfElements--;
if (ht->pDestructor) {
ht->pDestructor(q->pData);
}
......@@ -1362,7 +1363,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
pefree(q->pData, ht->persistent);
}
pefree(q, ht->persistent);
ht->nNumOfElements--;
}
if (p->pNext) {
......
This diff is collapsed.
......@@ -258,6 +258,8 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
SCNG(input_filter) = lex_state->input_filter;
SCNG(output_filter) = lex_state->output_filter;
SCNG(script_encoding) = lex_state->script_encoding;
RESET_DOC_COMMENT();
}
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
......@@ -541,6 +543,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
CG(zend_lineno) = 1;
}
RESET_DOC_COMMENT();
CG(increment_lineno) = 0;
return SUCCESS;
}
......@@ -691,6 +694,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
zend_set_compiled_filename(filename TSRMLS_CC);
CG(zend_lineno) = 1;
CG(increment_lineno) = 0;
RESET_DOC_COMMENT();
return SUCCESS;
}
......
......@@ -1530,7 +1530,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
/* If both are objects sharing the same comparision handler then use is */
if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) {
if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) {
/* object handles are identical, apprently this is the same object */
/* object handles are identical, apparently this is the same object */
ZVAL_LONG(result, 0);
return SUCCESS;
}
......
......@@ -1996,6 +1996,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&ret->var.ptr);
}
} else if (RETURN_VALUE_USED(opline)) {
EX_T(opline->result.var).var.ptr = NULL;
}
} else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
......
......@@ -548,6 +548,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&ret->var.ptr);
}
} else if (RETURN_VALUE_USED(opline)) {
EX_T(opline->result.var).var.ptr = NULL;
}
} else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
......@@ -1832,7 +1832,7 @@ AC_TRY_COMPILE([
])
dnl -------------------------------------------------------------------------
dnl Library/function existance and build sanity checks
dnl Library/function existence and build sanity checks
dnl -------------------------------------------------------------------------
dnl
......
......@@ -1832,7 +1832,7 @@ AC_TRY_COMPILE([
])
dnl -------------------------------------------------------------------------
dnl Library/function existance and build sanity checks
dnl Library/function existence and build sanity checks
dnl -------------------------------------------------------------------------
dnl
......
......@@ -376,11 +376,11 @@ while [ $# -gt 0 ]; do
eval "opt_${opt_OPT}=yes"
;;
':' )
# option with argument (multiple occurances override)
# option with argument (multiple occurrences override)
eval "opt_${opt_OPT}=\"\$opt_ARG\""
;;
'+' )
# option with argument (multiple occurances append)
# option with argument (multiple occurrences append)
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\""
;;
* )
......
......@@ -3687,7 +3687,7 @@ ac_config_headers="$ac_config_headers main/php_config.h"
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=5
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="RC3"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr $PHP_MAJOR_VERSION \* 10000 + $PHP_MINOR_VERSION \* 100 + $PHP_RELEASE_VERSION`
......@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=5
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="RC3"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
......
......@@ -518,7 +518,7 @@ static PHP_FUNCTION(bzcompress)
efree(dest);
RETURN_LONG(error);
} else {
/* Copy the buffer, we have perhaps allocate alot more than we need,
/* Copy the buffer, we have perhaps allocate a lot more than we need,
so we erealloc() the buffer to the proper size */
dest = erealloc(dest, dest_len + 1);
dest[dest_len] = 0;
......
......@@ -7,7 +7,7 @@ Bug #51997 (SEEK_CUR with 0 value, returns a warning)
error_reporting(E_ALL);
$filename = "testfile.bz2";
$filename = "bug51997.bz2";
$str = "This is a test string.\n";
$bz = bzopen($filename, "w");
bzwrite($bz, $str);
......
......@@ -7,7 +7,7 @@ BZ2 with files
error_reporting(E_ALL);
$filename = "testfile.bz2";
$filename = "with_files.bz2";
$str = "This is a test string.\n";
$bz = bzopen($filename, "w");
bzwrite($bz, $str);
......
......@@ -429,7 +429,7 @@ PHP_FUNCTION(com_variant_create_instance)
/* If already an array and VT_ARRAY is passed then:
- if only VT_ARRAY passed then do not perform a conversion
- if VT_ARRAY plus other type passed then perform conversion
but will probably fail (origional behavior)
but will probably fail (original behavior)
*/
if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) {
long orig_vt = vt;
......
......@@ -2384,18 +2384,9 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
return props;
}
#define PHP_DATE_INTERVAL_ADD_PROPERTY_I64(n, f) \
do { \
char i64_buf[DATE_I64_BUF_LEN]; \
MAKE_STD_ZVAL(zv); \
DATE_I64A(intervalobj->diff->f, i64_buf, DATE_I64_BUF_LEN); \
ZVAL_STRING(zv, i64_buf, 1); \
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL); \
} while(0);
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
MAKE_STD_ZVAL(zv); \
ZVAL_LONG(zv, intervalobj->diff->f); \
ZVAL_LONG(zv, (long)intervalobj->diff->f); \
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL);
PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
......@@ -2409,14 +2400,14 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
PHP_DATE_INTERVAL_ADD_PROPERTY("first_last_day_of", first_last_day_of);
PHP_DATE_INTERVAL_ADD_PROPERTY("invert", invert);
if (intervalobj->diff->days != -99999) {
PHP_DATE_INTERVAL_ADD_PROPERTY_I64("days", days);
PHP_DATE_INTERVAL_ADD_PROPERTY("days", days);
} else {
MAKE_STD_ZVAL(zv);
ZVAL_FALSE(zv);
zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL);
}
PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type);
PHP_DATE_INTERVAL_ADD_PROPERTY_I64("special_amount", special.amount);
PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount);
PHP_DATE_INTERVAL_ADD_PROPERTY("have_weekday_relative", have_weekday_relative);
PHP_DATE_INTERVAL_ADD_PROPERTY("have_special_relative", have_special_relative);
......
......@@ -34,11 +34,11 @@ object(DateInterval)#%d (15) {
["invert"]=>
int(0)
["days"]=>
string(1) "3"
int(3)
["special_type"]=>
int(0)
["special_amount"]=>
string(1) "0"
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
......
......@@ -34,7 +34,7 @@ object(DateInterval)#1 (15) {
["special_type"]=>
int(0)
["special_amount"]=>
string(1) "0"
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
......
......@@ -54,17 +54,17 @@ object(DateInterval)#3 (15) {
["invert"]=>
int(0)
["days"]=>
string(1) "0"
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
string(1) "0"
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
string(328) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:1:"0";s:12:"special_type";i:0;s:14:"special_amount";s:1:"0";s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}"
string(320) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";i:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}"
DateInterval::__set_state(array(
'y' => 0,
'm' => 0,
......@@ -76,9 +76,9 @@ DateInterval::__set_state(array(
'weekday_behavior' => 0,
'first_last_day_of' => 0,
'invert' => 0,
'days' => '0',
'days' => 0,
'special_type' => 0,
'special_amount' => '0',