Commit 60fede4c authored by Ondrej Sury's avatar Ondrej Sury

New upstream version 5.6.4+dfsg

parent f40f1ce1
......@@ -42,5 +42,5 @@ before_script:
# Run PHPs run-tests.php
script:
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 -s
- ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg
......@@ -42,7 +42,7 @@ Exceptions:
4. When writing functions that deal with strings, be sure to remember
that PHP holds the length property of each string, and that it
shouldn't be calculated with strlen(). Write your functions in a such
shouldn't be calculated with strlen(). Write your functions in such
a way so that they'll take advantage of the length property, both
for efficiency and in order for them to be binary-safe.
Functions that change strings and obtain their new lengths while
......
......@@ -155,7 +155,7 @@ Table of Contents
a list of all available options along with short explanations running
./configure --help. Our manual documents the different options
separately. You will find the core options in the appendix, while the
different extension specific options are descibed on the reference
different extension specific options are described on the reference
pages.
When PHP is configured, you are ready to build the module and/or
......
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 Dec 2014, PHP 5.6.4
- Core:
. Fixed bug #68091 (Some Zend headers lack appropriate extern "C" blocks).
(Adam)
. Fixed bug #68104 (Segfault while pre-evaluating a disabled function).
(Laruence)
. Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly
triggered). (Julien)
. Fixed bug #68355 (Inconsistency in example php.ini comments).
(Chris McCafferty)
. Fixed bug #68370 ("unset($this)" can make the program crash). (Laruence)
. Fixed bug #68422 (Incorrect argument reflection info for array_multisort()).
(Alexander Lisachenko)
. Fixed bug #68545 (NULL pointer dereference in unserialize.c). (Anatol)
. Fixed bug #68446 (Array constant not accepted for array parameter default).
(Bob, Dmitry)
. Fixed bug #68594 (Use after free vulnerability in unserialize()).
(CVE-2014-8142) (Stefan Esser)
- Date:
. Fixed day_of_week function as it could sometimes return negative values
internally. (Derick)
- FPM:
. Fixed bug #68381 (fpm_unix_init_main ignores log_level).
(David Zuelke, Remi)
. Fixed bug #68420 (listen=9000 listens to ipv6 localhost instead of all
addresses). (Remi)
. Fixed bug #68421 (access.format='%R' doesn't log ipv6 address). (Remi)
. Fixed bug #68423 (PHP-FPM will no longer load all pools). (Remi)
. Fixed bug #68428 (listen.allowed_clients is IPv4 only). (Remi)
. Fixed bug #68452 (php-fpm man page is oudated). (Remi)
. Fixed request #68458 (Change pm.start_servers default warning to
notice). (David Zuelke, Remi)
. Fixed bug #68463 (listen.allowed_clients can silently result
in no allowed access). (Remi)
. Fixed request #68391 (php-fpm conf files loading order).
(Florian Margaine, Remi)
. Fixed bug #68478 (access.log don't use prefix). (Remi)
- Mcrypt:
. Fixed possible read after end of buffer and use after free. (Dmitry)
- GMP:
. Fixed bug #68419 (build error with gmp 4.1). (Remi)
- PDO_pgsql:
. Fixed bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception
when not in transaction) (Matteo)
. Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
(Matteo)
- Session:
. Fixed bug #68331 (Session custom storage callable functions not being called)
(Yasuo Ohgaki)
- SOAP:
. Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes).
(Laruence)
- zlib:
. Fixed bug #53829 (Compiling PHP with large file support will replace
function gzopen by gzopen64) (Sascha Kettler, Matteo)
13 Nov 2014, PHP 5.6.3
- Core:
......@@ -400,6 +465,7 @@ PHP NEWS
. Fixed issue with null bytes in LDAP bindings. (Matthew Daley)
- litespeed
. Updated LiteSpeed SAPI code to V6.6 (George Wang)
. Fixed bug #63228 (-Werror=format-security error in lsapi code).
(Elan Ruusamäe, George)
......
......@@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by
'make test'. server-tests was developed to provide support for
testing PHP under it's primary environment, HTTP, and can run the
PHP tests under any of the SAPI modules that are direct executables,
or are accessable via HTTP.
or are accessible via HTTP.
[New features]
----------------
......@@ -95,7 +95,7 @@ include:
$filename full native path to file, will become PATH_TRANSLATED
$filepath =dirname($filename)
$scriptname this is what will become SCRIPT_NAME unless you override it
$docroot the equivelant of DOCUMENT_ROOT under Apache
$docroot the equivalent of DOCUMENT_ROOT under Apache
$cwd the directory that the test is being initiated from
$this->conf all server-tests configuration vars
$this->env all environment variables that will get passed to the test
......@@ -105,7 +105,7 @@ include:
This section is also eval'd, and is similar in nature to --ENV--. However,
this section is used to build the url used in an HTTP request. Valid values
to set in this section would include:
SCRIPT_NAME The inital part of the request url
SCRIPT_NAME The initial part of the request url
PATH_INFO The pathinfo part of a request url
FRAGMENT The fragment section of a url (after #)
QUERY_STRING The query part of a url (after ?)
......
......@@ -19,6 +19,6 @@ $b = new b();
$b->test();
--EXPECTF--
Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s/bug67436/b.php on line %d
Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.php on line %d
b::test()
a::test(c::TESTCONSTANT)
--TEST--
Bug #68370 "unset($this)" can make the program crash
--FILE--
<?php
class C {
public function test() {
unset($this);
return get_defined_vars();
}
}
$c = new C();
$x = $c->test();
print_r($x);
unset($c, $x);
--EXPECTF--
Array
(
)
--TEST--
Bug #68446 (Array constant not accepted for array parameter default)
--FILE--
<?php
const FOO = [1];
const BAR = null;
function a(array $a = FOO) {
var_dump($a);
}
function b(array $b = BAR) {
var_dump($b);
}
b(null);
b([]);
b();
a([]);
a();
a(null);
?>
--EXPECTF--
NULL
array(0) {
}
NULL
array(0) {
}
array(1) {
[0]=>
int(1)
}
Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
......@@ -2635,18 +2635,15 @@ ZEND_API ZEND_FUNCTION(display_disabled_function)
}
/* }}} */
static zend_function_entry disabled_function[] = {
ZEND_FE(display_disabled_function, NULL)
ZEND_FE_END
};
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
{
if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
return FAILURE;
zend_internal_function *func;
if (zend_hash_find(CG(function_table), function_name, function_name_length+1, (void **)&func)==SUCCESS) {
func->arg_info = NULL;
func->handler = ZEND_FN(display_disabled_function);
return SUCCESS;
}
disabled_function[0].fname = function_name;
return zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC);
return FAILURE;
}
/* }}} */
......
......@@ -1931,8 +1931,11 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
if (class_type->u.constant.type == IS_ARRAY) {
cur_arg_info->type_hint = IS_ARRAY;
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
cur_arg_info->allow_null = 1;
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
/* delay constant resolution and check to run-time */
cur_arg_info->allow_null = 0;
} else if (Z_TYPE(initialization->u.constant) != IS_ARRAY) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
}
......@@ -1940,8 +1943,11 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
} else if (class_type->u.constant.type == IS_CALLABLE) {
cur_arg_info->type_hint = IS_CALLABLE;
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
cur_arg_info->allow_null = 1;
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
/* delay constant resolution and check to run-time */
cur_arg_info->allow_null = 0;
} else {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL");
}
......@@ -1955,8 +1961,11 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
cur_arg_info->class_name = Z_STRVAL(class_type->u.constant);
cur_arg_info->class_name_len = Z_STRLEN(class_type->u.constant);
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
cur_arg_info->allow_null = 1;
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
/* delay constant resolution and check to run-time */
cur_arg_info->allow_null = 0;
} else {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL");
}
......@@ -4246,8 +4255,8 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
/* make sure that the trait method is not from a class mentioned in
exclude_from_classes, for consistency */
if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) {
zend_error_noreturn(E_COMPILE_ERROR,
if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[j]) {
zend_error(E_COMPILE_ERROR,
"Inconsistent insteadof definition. "
"The method %s is to be used from %s, but %s is also on the exclude list",
cur_method_ref->method_name,
......
......@@ -608,7 +608,22 @@ ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend
return 0;
}
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type TSRMLS_DC)
static int is_null_constant(zval *default_value TSRMLS_DC)
{
if (IS_CONSTANT_TYPE(Z_TYPE_P(default_value))) {
zval constant = *default_value;
zval *constant_ptr = &constant;
zval_update_constant(&constant_ptr, 0 TSRMLS_CC);
if (Z_TYPE(constant) == IS_NULL) {
return 1;
}
zval_dtor(&constant);
}
return 0;
}
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type, zval *default_value TSRMLS_DC)
{
zend_arg_info *cur_arg_info;
char *need_msg;
......@@ -638,7 +653,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name TSRMLS_CC);
}
} else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
} else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC)))) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC);
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "" TSRMLS_CC);
}
......@@ -649,7 +664,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "" TSRMLS_CC);
}
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "" TSRMLS_CC);
}
break;
......@@ -658,7 +673,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
if (!arg) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "" TSRMLS_CC);
}
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "" TSRMLS_CC);
}
break;
......
......@@ -1236,6 +1236,10 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */
#ifdef ZEND_WIN32
static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* {{{ */
{
#ifdef ZTS
THREAD_T thread_id = (THREAD_T)wParam;
#endif
switch (message) {
case WM_DESTROY:
PostQuitMessage(0);
......@@ -1250,7 +1254,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa
#endif
SetTimer(timeout_window, wParam, lParam*1000, NULL);
#ifdef ZTS
tsrm_ls = ts_resource_ex(0, &wParam);
tsrm_ls = ts_resource_ex(0, &thread_id);
if (!tsrm_ls) {
/* shouldn't normally happen */
break;
......@@ -1267,7 +1271,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa
#ifdef ZTS
void ***tsrm_ls;
tsrm_ls = ts_resource_ex(0, &wParam);
tsrm_ls = ts_resource_ex(0, &thread_id);
if (!tsrm_ls) {
/* Thread died before receiving its timeout? */
break;
......@@ -1656,13 +1660,6 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
/*printf("Cache miss! Initialized %x\n", EG(active_symbol_table));*/
}
ex->symbol_table = EG(active_symbol_table);
if (ex->op_array->this_var != -1 &&
!*EX_CV_NUM(ex, ex->op_array->this_var) &&
EG(This)) {
*EX_CV_NUM(ex, ex->op_array->this_var) = (zval**)EX_CV_NUM(ex, ex->op_array->last_var + ex->op_array->this_var);
**EX_CV_NUM(ex, ex->op_array->this_var) = EG(This);
}
for (i = 0; i < ex->op_array->last_var; i++) {
if (*EX_CV_NUM(ex, i)) {
zend_hash_quick_update(EG(active_symbol_table),
......
......@@ -21,6 +21,8 @@
#ifndef ZEND_FLOAT_H
#define ZEND_FLOAT_H
BEGIN_EXTERN_C()
/*
Define functions for FP initialization and de-initialization.
*/
......@@ -28,6 +30,8 @@ extern ZEND_API void zend_init_fpu(TSRMLS_D);
extern ZEND_API void zend_shutdown_fpu(TSRMLS_D);
extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D);
END_EXTERN_C()
/* Copy of the contents of xpfpa.h (which is under public domain)
See http://wiki.php.net/rfc/rounding for details.
......
......@@ -21,9 +21,13 @@
#ifndef ZEND_VM_H
#define ZEND_VM_H
BEGIN_EXTERN_C()
ZEND_API void zend_vm_use_old_executor(void);
ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode);
END_EXTERN_C()
#define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline)
#endif
......@@ -1961,7 +1961,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
void **p = EX(function_state).arguments - num_args;
for (i = 0; i < num_args; ++i, ++p) {
zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0 TSRMLS_CC);
zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0, NULL TSRMLS_CC);
}
}
......@@ -3374,7 +3374,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
SAVE_OPLINE();
if (UNEXPECTED(param == NULL)) {
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value, NULL TSRMLS_CC)) {
const char *space;
const char *class_name;
zend_execute_data *ptr;
......@@ -3396,7 +3396,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
} else {
zval **var_ptr;
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
Z_DELREF_PP(var_ptr);
*var_ptr = *param;
......@@ -3438,7 +3438,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
Z_ADDREF_P(assignment_value);
}
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value, opline->op2.zv TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
zval_ptr_dtor(var_ptr);
*var_ptr = assignment_value;
......@@ -3469,7 +3469,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
for (; arg_num <= arg_count; ++arg_num) {
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL);
Z_ADDREF_PP(param);
}
......
......@@ -541,7 +541,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
void **p = EX(function_state).arguments - num_args;
for (i = 0; i < num_args; ++i, ++p) {
zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0 TSRMLS_CC);
zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0, NULL TSRMLS_CC);
}
}
......@@ -861,7 +861,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
if (UNEXPECTED(param == NULL)) {
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value, NULL TSRMLS_CC)) {
const char *space;
const char *class_name;
zend_execute_data *ptr;
......@@ -883,7 +883,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval **var_ptr;
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
Z_DELREF_PP(var_ptr);
*var_ptr = *param;
......@@ -916,7 +916,7 @@ static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
for (; arg_num <= arg_count; ++arg_num) {
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL);
Z_ADDREF_PP(param);
}
......@@ -1643,7 +1643,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
Z_ADDREF_P(assignment_value);
}
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value, opline->op2.zv TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
zval_ptr_dtor(var_ptr);
*var_ptr = assignment_value;
......@@ -1208,7 +1208,9 @@ function gen_vm($def, $skel) {
out($f, $GLOBALS['header_text']);
fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n");
fputs($f, "BEGIN_EXTERN_C()\n\n");
fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n");
fputs($f, "END_EXTERN_C()\n\n");
foreach ($opcodes as $code => $dsc) {
$code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT);
......
......@@ -21,8 +21,12 @@
#ifndef ZEND_VM_OPCODES_H
#define ZEND_VM_OPCODES_H
BEGIN_EXTERN_C()
ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
END_EXTERN_C()
#define ZEND_NOP 0
#define ZEND_ADD 1
#define ZEND_SUB 2
......
......@@ -3667,7 +3667,7 @@ ac_config_headers="$ac_config_headers main/php_config.h"
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=6
PHP_RELEASE_VERSION=3
PHP_RELEASE_VERSION=4
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`
......@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=6
PHP_RELEASE_VERSION=3
PHP_RELEASE_VERSION=4
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`
......
......@@ -47,7 +47,7 @@
*
* CALENDAR OVERVIEW
*
* Julias Ceasar created the calendar in 46 B.C. as a modified form of
* Julius Caesar created the calendar in 46 B.C. as a modified form of
* the old Roman republican calendar which was based on lunar cycles.
* The new Julian calendar set fixed lengths for the months, abandoning
* the lunar cycle. It also specified that there would be exactly 12
......
......@@ -21,10 +21,10 @@ putenv('TZ=UTC');
// -uses --INI-- section with date.timezone=UTC
// -uses putenv('TZ=UTC')
// date.timezone=UTC
// -if ommitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
// -if omitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
// -easter_date() calls mktime() and localtime()
// -whereas unixtojd(1000000000) calls localtime(1000000000)
// -if ommitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
// -if omitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
//
// unixtojd() calls php_localtime_r() which for Pacific timezone systems, returns a time -8 hours
// -this incorrect localtime is passed to the julian date conversion (GregorianToSDN) function which works (probably correctly)
......
......@@ -13,6 +13,6 @@ var_dump(curl_setopt($ch, CURLOPT_URL, $url));
?>
Done
--EXPECTF--
Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4
Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s%ebug68089.php on line 4
bool(false)
Done
--TEST--
Test curl_multi_init() fail if any parameter is passed
--CREDITS--
Paulo Eduardo <pauloelr [at] gmail [dot] com>
#testfest SP 2014
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
/* Prototype : resource curl_multi_init(void)
* Description : Returns a new cURL multi handle
* Source code : ext/curl/multi.c
* Test documentation: http://wiki.php.net/qa/temp/ext/curl
*/
// start testing
//create the multiple cURL handle
$mh = curl_multi_init('test');
var_dump($mh);
?>
===DONE===
--EXPECTF--
Warning: curl_multi_init() expects exactly 0 parameters, %d given in %s on line %d
NULL
===DONE===
......@@ -23,9 +23,21 @@
static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
static timelib_sll positive_mod(timelib_sll x, timelib_sll y)
{
timelib_sll tmp;
tmp = x % y;
if (tmp < 0) {
tmp += y;
}
return tmp;
}
static timelib_sll century_value(timelib_sll j)
{
return 6 - (j % 4) * 2;
return 6 - positive_mod(j, 4) * 2;
}
static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso)
......@@ -36,9 +48,9 @@ static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_
* Julian calendar. We just return the 'wrong' day of week to be
* consistent. */
c1 = century_value(y / 100);
y1 = (y % 100);
y1 = positive_mod(y, 100);
m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m];
dow = (c1 + y1 + m1 + (y1 / 4) + d) % 7;
dow = positive_mod((c1 + y1 + m1 + (y1 / 4) + d), 7);
if (iso) {
if (dow == 0) {
dow = 7;
......
......@@ -336,7 +336,7 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
{