1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-7.4'

This commit is contained in:
Johannes Schlüter
2019-02-12 15:02:18 +01:00
59 changed files with 365 additions and 177 deletions

View File

@@ -16,7 +16,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta1
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta3
PHP_BUILD_CRT: vc15
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!

View File

@@ -368,7 +368,9 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
ret_constant = NULL;
} else {
if (!zend_verify_const_access(c, scope)) {
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
}
goto failure;
}
ret_constant = &c->value;

View File

@@ -5218,7 +5218,6 @@ PHP_METHOD(DatePeriod, __wakeup)
/* {{{ date_period_read_property */
static zval *date_period_read_property(zend_object *object, zend_string *name, int type, void **cache_slot, zval *rv)
{
zval *zv;
if (type != BP_VAR_IS && type != BP_VAR_R) {
zend_throw_error(NULL, "Retrieval of DatePeriod properties for modification is unsupported");
return &EG(uninitialized_zval);
@@ -5226,13 +5225,7 @@ static zval *date_period_read_property(zend_object *object, zend_string *name, i
object->handlers->get_properties(object); /* build properties hash table */
zv = zend_std_read_property(object, name, type, cache_slot, rv);
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
/* defensive copy */
ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(Z_OBJ_P(zv)));
}
return zv;
return zend_std_read_property(object, name, type, cache_slot, rv);
}
/* }}} */

View File

@@ -3377,6 +3377,10 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_USERCOMMENT:
EFREE_IF(ImageInfo->UserComment);
ImageInfo->UserComment = NULL;
EFREE_IF(ImageInfo->UserCommentEncoding);
ImageInfo->UserCommentEncoding = NULL;
ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
break;

Binary file not shown.

View File

@@ -0,0 +1,18 @@
--TEST--
Bug 77564 (Memory leak in exif_process_IFD_TAG)
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
var_dump(exif_read_data(dirname(__FILE__) . '/bug77564.jpg'));
?>
DONE
--EXPECTF--
Warning: exif_read_data(bug77564.jpg): Illegal IFD offset in %sbug77564.php on line %d
Warning: exif_read_data(bug77564.jpg): File structure corrupted in %sbug77564.php on line %d
Warning: exif_read_data(bug77564.jpg): Invalid JPEG file in %sbug77564.php on line %d
bool(false)
DONE

View File

@@ -1117,10 +1117,16 @@ static void zend_ffi_cdata_write_dim(zend_object *obj, zval *offset, zval *value
{
zend_ffi_cdata *cdata = (zend_ffi_cdata*)obj;
zend_ffi_type *type = ZEND_FFI_TYPE(cdata->type);
zend_long dim = zval_get_long(offset);
zend_long dim;
void *ptr;
zend_ffi_flags is_const;
if (offset == NULL) {
zend_throw_error(zend_ffi_exception_ce, "Cannot add next element to object of type FFI\\CData");
return;
}
dim = zval_get_long(offset);
if (EXPECTED(type->kind == ZEND_FFI_TYPE_ARRAY)) {
if (UNEXPECTED((zend_ulong)(dim) >= (zend_ulong)type->array.length)
&& (UNEXPECTED(dim < 0) || UNEXPECTED(type->array.length != 0))) {
@@ -5257,7 +5263,7 @@ void zend_ffi_add_bit_field(zend_ffi_dcl *struct_dcl, const char *name, size_t n
zend_ffi_parser_error("wrong type of bit field '%.*s' at line %d", name ? name_len : sizeof("<anonymous>")-1, name ? name : "<anonymous>", FFI_G(line));
}
if (bits->kind == ZEND_FFI_VAL_INT32 || ZEND_FFI_VAL_INT64) {
if (bits->kind == ZEND_FFI_VAL_INT32 || bits->kind == ZEND_FFI_VAL_INT64) {
if (bits->i64 < 0) {
zend_ffi_cleanup_dcl(field_dcl);
zend_ffi_parser_error("negative width in bit-field '%.*s' at line %d", name ? name_len : sizeof("<anonymous>")-1, name ? name : "<anonymous>", FFI_G(line));
@@ -5271,7 +5277,7 @@ void zend_ffi_add_bit_field(zend_ffi_dcl *struct_dcl, const char *name, size_t n
zend_ffi_cleanup_dcl(field_dcl);
zend_ffi_parser_error("width of '%.*s' exceeds its type at line %d", name ? name_len : sizeof("<anonymous>")-1, name ? name : "<anonymous>", FFI_G(line));
}
} else if (ZEND_FFI_VAL_UINT32 || ZEND_FFI_VAL_UINT64) {
} else if (bits->kind == ZEND_FFI_VAL_UINT32 || bits->kind == ZEND_FFI_VAL_UINT64) {
if (bits->u64 == 0) {
zend_ffi_cleanup_dcl(field_dcl);
if (name) {

16
ext/ffi/tests/042.phpt Normal file
View File

@@ -0,0 +1,16 @@
--TEST--
FFI 042: Next array element
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--INI--
ffi.enable=1
--FILE--
<?php
$a = FFI::new("uint8_t[8]");
$a[] = 0;
?>
--EXPECTF--
Fatal error: Uncaught FFI\Exception: Cannot add next element to object of type FFI\CData in %s:3
Stack trace:
#0 {main}
thrown in %s on line 3

View File

@@ -0,0 +1,77 @@
--TEST--
mb_str*() - unknown encoding
--CREDITS--
Jachim Coudenys <jachimcoudenys@gmail.com>
User Group: PHP-WVL & PHPGent #PHPTestFest
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
mb_chr(1, 'UTF-0');
mb_convert_case('coudenys', MB_CASE_UPPER, 'UTF-0');
mb_convert_encoding('coudenys', 'UTF-8', 'UTF-0');
mb_convert_kana('coudenys', 'KV', 'UTF-0');
mb_decode_numericentity('coudenys', 'KV', 'UTF-0');
mb_ord('coudenys', 'UTF-0');
mb_strcut('coudenys', 0, 4, 'UTF-0');
mb_strimwidth('coudenys', 0, 4, '', 'UTF-0');
mb_stripos('coudenys', 'cou', 0, 'UTF-0');
mb_stristr('coudenys', 'cou', false, 'UTF-0');
mb_strlen('coudenys', 'UTF-0');
mb_strpos('coudenys', 'cou', 0, 'UTF-0');
mb_strrchr('coudenys', 'cou', false, 'UTF-0');
mb_strrichr('coudenys', 'cou', false, 'UTF-0');
mb_strripos('coudenys', 'cou', 0, 'UTF-0');
mb_strrpos('coudenys', 'cou', 0, 'UTF-0');
mb_strstr('coudenys', 'cou', false, 'UTF-0');
mb_strtolower('coudenys', 'UTF-0');
mb_strtoupper('coudenys', 'UTF-0');
mb_strwidth('coudenys', 'UTF-0');
mb_substr('coudenys', 0, null, 'UTF-0');
mb_substr_count('coudenys', 'c', 'UTF-0');
?>
--EXPECTF--
Warning: mb_chr(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_convert_case(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_convert_encoding(): Illegal character encoding specified in %s on line %d
Warning: mb_convert_kana(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_decode_numericentity(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_ord(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strcut(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strimwidth(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_stripos(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_stristr(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strlen(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strpos(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strrchr(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strrichr(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strripos(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strrpos(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strstr(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strtolower(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strtoupper(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_strwidth(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_substr(): Unknown encoding "UTF-0" in %s on line %d
Warning: mb_substr_count(): Unknown encoding "UTF-0" in %s on line %d

View File

@@ -797,6 +797,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
MYSQLND_PACKET_ROW * row_packet;
MYSQLND_CONN_DATA * conn = result->conn;
const MYSQLND_RES_METADATA * const meta = result->meta;
void *checkpoint;
DBG_ENTER("mysqlnd_stmt_fetch_row_unbuffered");
@@ -819,6 +820,9 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
/* Let the row packet fill our buffer and skip additional malloc + memcpy */
row_packet->skip_extraction = stmt && stmt->result_bind? FALSE:TRUE;
checkpoint = result->memory_pool->checkpoint;
mysqlnd_mempool_save_state(result->memory_pool);
/*
If we skip rows (stmt == NULL || stmt->result_bind == NULL) we have to
result->unbuf->m.free_last_data() before it. The function returns always true.
@@ -841,6 +845,8 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
conn->options->int_and_float_native,
conn->stats))
{
mysqlnd_mempool_restore_state(result->memory_pool);
result->memory_pool->checkpoint = checkpoint;
DBG_RETURN(FAIL);
}
@@ -900,6 +906,9 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
}
}
mysqlnd_mempool_restore_state(result->memory_pool);
result->memory_pool->checkpoint = checkpoint;
DBG_INF_FMT("ret=%s fetched_anything=%u", ret == PASS? "PASS":"FAIL", *fetched_anything);
DBG_RETURN(ret);
}

View File

@@ -238,11 +238,12 @@ static inline void accel_restart_enter(void)
#ifdef ZEND_WIN32
INCREMENT(restart_in);
#else
# ifdef _AIX
static FLOCK_STRUCTURE(restart_in_progress, F_WRLCK, SEEK_SET, 2, 1);
# else
static const FLOCK_STRUCTURE(restart_in_progress, F_WRLCK, SEEK_SET, 2, 1);
#endif
struct flock restart_in_progress;
restart_in_progress.l_type = F_WRLCK;
restart_in_progress.l_whence = SEEK_SET;
restart_in_progress.l_start = 2;
restart_in_progress.l_len = 1;
if (fcntl(lock_file, F_SETLK, &restart_in_progress) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "RestartC(+1): %s (%d)", strerror(errno), errno);
@@ -257,11 +258,12 @@ static inline void accel_restart_leave(void)
ZCSG(restart_in_progress) = 0;
DECREMENT(restart_in);
#else
# ifdef _AIX
static FLOCK_STRUCTURE(restart_finished, F_UNLCK, SEEK_SET, 2, 1);
# else
static const FLOCK_STRUCTURE(restart_finished, F_UNLCK, SEEK_SET, 2, 1);
# endif
struct flock restart_finished;
restart_finished.l_type = F_UNLCK;
restart_finished.l_whence = SEEK_SET;
restart_finished.l_start = 2;
restart_finished.l_len = 1;
ZCSG(restart_in_progress) = 0;
if (fcntl(lock_file, F_SETLK, &restart_finished) == -1) {
@@ -274,7 +276,12 @@ static inline int accel_restart_is_active(void)
{
if (ZCSG(restart_in_progress)) {
#ifndef ZEND_WIN32
FLOCK_STRUCTURE(restart_check, F_WRLCK, SEEK_SET, 2, 1);
struct flock restart_check;
restart_check.l_type = F_WRLCK;
restart_check.l_whence = SEEK_SET;
restart_check.l_start = 2;
restart_check.l_len = 1;
if (fcntl(lock_file, F_GETLK, &restart_check) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "RestartC: %s (%d)", strerror(errno), errno);
@@ -299,11 +306,12 @@ static inline int accel_activate_add(void)
#ifdef ZEND_WIN32
INCREMENT(mem_usage);
#else
# ifdef _AIX
static FLOCK_STRUCTURE(mem_usage_lock, F_RDLCK, SEEK_SET, 1, 1);
# else
static const FLOCK_STRUCTURE(mem_usage_lock, F_RDLCK, SEEK_SET, 1, 1);
# endif
struct flock mem_usage_lock;
mem_usage_lock.l_type = F_RDLCK;
mem_usage_lock.l_whence = SEEK_SET;
mem_usage_lock.l_start = 1;
mem_usage_lock.l_len = 1;
if (fcntl(lock_file, F_SETLK, &mem_usage_lock) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "UpdateC(+1): %s (%d)", strerror(errno), errno);
@@ -322,11 +330,12 @@ static inline void accel_deactivate_sub(void)
ZCG(counted) = 0;
}
#else
# ifdef _AIX
static FLOCK_STRUCTURE(mem_usage_unlock, F_UNLCK, SEEK_SET, 1, 1);
# else
static const FLOCK_STRUCTURE(mem_usage_unlock, F_UNLCK, SEEK_SET, 1, 1);
# endif
struct flock mem_usage_unlock;
mem_usage_unlock.l_type = F_UNLCK;
mem_usage_unlock.l_whence = SEEK_SET;
mem_usage_unlock.l_start = 1;
mem_usage_unlock.l_len = 1;
if (fcntl(lock_file, F_SETLK, &mem_usage_unlock) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "UpdateC(-1): %s (%d)", strerror(errno), errno);
@@ -339,11 +348,12 @@ static inline void accel_unlock_all(void)
#ifdef ZEND_WIN32
accel_deactivate_sub();
#else
# ifdef _AIX
static FLOCK_STRUCTURE(mem_usage_unlock_all, F_UNLCK, SEEK_SET, 0, 0);
# else
static const FLOCK_STRUCTURE(mem_usage_unlock_all, F_UNLCK, SEEK_SET, 0, 0);
# endif
struct flock mem_usage_unlock_all;
mem_usage_unlock_all.l_type = F_UNLCK;
mem_usage_unlock_all.l_whence = SEEK_SET;
mem_usage_unlock_all.l_start = 0;
mem_usage_unlock_all.l_len = 0;
if (fcntl(lock_file, F_SETLK, &mem_usage_unlock_all) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "UnlockAll: %s (%d)", strerror(errno), errno);
@@ -812,8 +822,12 @@ static inline int accel_is_inactive(void)
return SUCCESS;
}
#else
FLOCK_STRUCTURE(mem_usage_check, F_WRLCK, SEEK_SET, 1, 1);
struct flock mem_usage_check;
mem_usage_check.l_type = F_WRLCK;
mem_usage_check.l_whence = SEEK_SET;
mem_usage_check.l_start = 1;
mem_usage_check.l_len = 1;
mem_usage_check.l_pid = -1;
if (fcntl(lock_file, F_GETLK, &mem_usage_check) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "UpdateC: %s (%d)", strerror(errno), errno);

View File

@@ -89,19 +89,6 @@
/*** file locking ***/
#ifndef ZEND_WIN32
extern int lock_file;
# if defined(HAVE_FLOCK_AIX64)
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
struct flock name = {type, whence, 0, 0, 0, start, len }
# elif defined(HAVE_FLOCK_BSD)
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
struct flock name = {start, len, -1, type, whence}
# elif defined(HAVE_FLOCK_LINUX)
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
struct flock name = {type, whence, start, len}
# else
# error "Don't know how to define struct flock"
# endif
#endif
#if defined(ZEND_WIN32)

View File

@@ -334,63 +334,6 @@ int main() {
msg=yes],[msg=no],[msg=no])
AC_MSG_RESULT([$msg])
flock_type=unknown
AC_MSG_CHECKING(for struct flock layout)
if test "$flock_type" = "unknown"; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
struct flock lock = { 1, 2, 3, 4, 5, 6, 7 };
int main() {
if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 6 && lock.l_len== 7) {
return 0;
}
return 1;
}
]])], [
flock_type=aix64
AC_DEFINE([HAVE_FLOCK_AIX64], [], [Struct flock is 64-bit AIX-type])
], [])
fi
if test "$flock_type" = "unknown"; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
struct flock lock = { 1, 2, 3, 4, 5 };
int main() {
if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) {
return 0;
}
return 1;
}
]])], [
flock_type=linux
AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
], [])
fi
if test "$flock_type" = "unknown"; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
struct flock lock = { 1, 2, 3, 4, 5 };
int main() {
if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
return 0;
}
return 1;
}
]])], [
flock_type=bsd
AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
], [])
fi
AC_MSG_RESULT([$flock_type])
if test "$flock_type" = "unknown"; then
AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
fi
PHP_NEW_EXTENSION(opcache,
ZendAccelerator.c \
zend_accelerator_blacklist.c \

View File

@@ -435,15 +435,15 @@ void zend_shared_alloc_safe_unlock(void)
}
}
#ifndef ZEND_WIN32
/* name l_type l_whence l_start l_len */
static FLOCK_STRUCTURE(mem_write_lock, F_WRLCK, SEEK_SET, 0, 1);
static FLOCK_STRUCTURE(mem_write_unlock, F_UNLCK, SEEK_SET, 0, 1);
#endif
void zend_shared_alloc_lock(void)
{
#ifndef ZEND_WIN32
struct flock mem_write_lock;
mem_write_lock.l_type = F_WRLCK;
mem_write_lock.l_whence = SEEK_SET;
mem_write_lock.l_start = 0;
mem_write_lock.l_len = 1;
#ifdef ZTS
tsrm_mutex_lock(zts_lock);
@@ -474,6 +474,15 @@ void zend_shared_alloc_lock(void)
void zend_shared_alloc_unlock(void)
{
#ifndef ZEND_WIN32
struct flock mem_write_unlock;
mem_write_unlock.l_type = F_UNLCK;
mem_write_unlock.l_whence = SEEK_SET;
mem_write_unlock.l_start = 0;
mem_write_unlock.l_len = 1;
#endif
ZCG(locked) = 0;
#ifndef ZEND_WIN32

View File

@@ -1265,6 +1265,12 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi
break;
#endif
}
#if defined(SIGRTMIN) && defined(SIGRTMAX)
if (SIGRTMIN <= signo && signo <= SIGRTMAX) {
add_assoc_long_ex(user_siginfo, "pid", sizeof("pid")-1, siginfo->si_pid);
add_assoc_long_ex(user_siginfo, "uid", sizeof("uid")-1, siginfo->si_uid);
}
#endif
}
}
/* }}} */

View File

@@ -0,0 +1,20 @@
--TEST--
pcntl_signal() context of realtime signal
--SKIPIF--
<?php if (!defined('SIGRTMIN')) die("skip realtime signal not supported"); ?>
<?php if (!extension_loaded("pcntl")) print "skip"; ?>
<?php if (!extension_loaded("posix")) die("skip posix extension not available"); ?>
--FILE--
<?php
pcntl_signal(SIGRTMIN, function ($signo, $siginfo) {
printf("got realtime signal from %s, ruid:%s\n", $siginfo['pid'] ?? '', $siginfo['uid'] ?? '');
});
posix_kill(posix_getpid(), SIGRTMIN);
pcntl_signal_dispatch();
echo "ok\n";
?>
--EXPECTF--
%rgot realtime signal from \d+, ruid:\d+%r
ok

View File

@@ -781,6 +781,13 @@ static PHP_MINIT_FUNCTION(sockets)
REGISTER_LONG_CONSTANT("SO_ERROR", SO_ERROR, CONST_CS | CONST_PERSISTENT);
#ifdef SO_BINDTODEVICE
REGISTER_LONG_CONSTANT("SO_BINDTODEVICE", SO_BINDTODEVICE, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef SO_USER_COOKIE
REGISTER_LONG_CONSTANT("SO_LABEL", SO_LABEL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SO_PEERLABEL", SO_PEERLABEL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SO_LISTENQLIMIT", SO_LISTENQLIMIT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SO_LISTENQLEN", SO_LISTENQLEN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SO_USER_COOKIE", SO_USER_COOKIE, CONST_CS | CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("SOL_SOCKET", SOL_SOCKET, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SOMAXCONN", SOMAXCONN, CONST_CS | CONST_PERSISTENT);

View File

@@ -202,15 +202,6 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
case IS_TRUE:
smart_str_appendl(formstr, "1", sizeof("1")-1);
break;
case IS_DOUBLE:
{
char *ekey;
size_t ekey_len;
ekey_len = spprintf(&ekey, 0, "%.*G", (int) EG(precision), Z_DVAL_P(zdata));
smart_str_appendl(formstr, ekey, ekey_len);
efree(ekey);
}
break;
default:
{
zend_string *ekey;

View File

@@ -6,10 +6,7 @@ class Foo {
private const C1 = "a";
}
try {
var_dump(constant('Foo::C1'));
} catch (Error $e) {
var_dump($e->getMessage());
}
--EXPECT--
string(35) "Cannot access private const Foo::C1"
var_dump(constant('Foo::C1'));
--EXPECTF--
Warning: constant(): Couldn't find constant Foo::C1 in %s on line %d
NULL

View File

@@ -0,0 +1,11 @@
--TEST--
Bug #77608: http_build_query doesn't encode "+" in a float number
--FILE--
<?php
$a = ["x" => 1E+14, "y" => "1E+14"];
echo http_build_query($a);
?>
--EXPECT--
x=1.0E%2B14&y=1E%2B14

View File

@@ -10,7 +10,8 @@ precision=14
$path = dirname(__FILE__);
var_dump(wddx_deserialize(file_get_contents("{$path}/wddx.xml")));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(11) {
["aNull"]=>
NULL

View File

@@ -10,7 +10,8 @@ precision=14
$path = dirname(__FILE__);
var_dump(wddx_deserialize(file_get_contents("{$path}/wddx.xml")));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(11) {
["aNull"]=>
NULL

View File

@@ -17,5 +17,10 @@ precision=14
wddx_add_vars($pkt, 'var1', 'var2', array('var3', 'var4'));
echo wddx_packet_end($pkt);
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_packet_start() is deprecated in %s on line %d
Deprecated: Function wddx_add_vars() is deprecated in %s on line %d
Deprecated: Function wddx_packet_end() is deprecated in %s on line %d
<wddxPacket version='1.0'><header><comment>TEST comment</comment></header><data><struct><var name='var1'><null/></var><var name='var2'><string>some string</string></var><var name='var3'><number>756</number></var><var name='var4'><boolean value='true'/></var></struct></data></wddxPacket>

View File

@@ -13,7 +13,8 @@ precision=14
var_dump(wddx_deserialize($fp));
fclose($fp);
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(4) {
["var1"]=>
NULL

View File

@@ -16,5 +16,8 @@ Bug #27287 (segfault with deserializing object data)
echo "OK\n";
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_serialize_value() is deprecated in %s on line %d
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
OK

View File

@@ -10,5 +10,6 @@ $buf = wddx_serialize_value($var, 'name');
echo "OK\n";
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_serialize_value() is deprecated in %s on line %d
OK

View File

@@ -50,7 +50,8 @@ WDX;
var_dump(wddx_deserialize($wddx));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
["content_queries"]=>
array(1) {

View File

@@ -50,7 +50,8 @@ WDX;
var_dump(wddx_deserialize($wddx));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
["content_queries"]=>
array(1) {

View File

@@ -2,6 +2,8 @@
Bug #37569 (WDDX incorrectly encodes high-ascii characters)
--SKIPIF--
<?php if (!extension_loaded("wddx")) print "skip"; ?>
--INI--
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php
for ($i = 65; $i < 256; $i++) {

View File

@@ -23,7 +23,8 @@ EOF
?>
===DONE===
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
[0]=>
array(1) {

View File

@@ -10,7 +10,10 @@ $data = array(
var_dump(wddx_deserialize(wddx_serialize_vars('data')));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_serialize_vars() is deprecated in %s on line %d
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
["data"]=>
array(1) {

View File

@@ -8,7 +8,10 @@ $data = array('01' => 'Zero', '+1' => 'Plus sign', ' 1' => 'Space');
var_dump(wddx_deserialize(wddx_serialize_vars('data')));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_serialize_vars() is deprecated in %s on line %d
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
["data"]=>
array(3) {

View File

@@ -14,6 +14,8 @@ echo wddx_serialize_value($xml, 'Variables') . "\n";
echo "DONE";
?>
--EXPECTF--
Deprecated: Function wddx_serialize_value() is deprecated in %sbug45901.php on line %d
Warning: wddx_serialize_value(): Class SimpleXMLElement can not be serialized in %sbug45901.php on line %d
<wddxPacket version='1.0'><header><comment>Variables</comment></header><data></data></wddxPacket>
DONE

View File

@@ -29,6 +29,10 @@ var_dump(wddx_serialize_vars($a));
?>
--EXPECTF--
Deprecated: Function wddx_serialize_vars() is deprecated in %s on line %d
Warning: wddx_serialize_vars(): recursion detected in %s on line %d
string(78) "<wddxPacket version='1.0'><header/><data><struct></struct></data></wddxPacket>"
Deprecated: Function wddx_serialize_vars() is deprecated in %s on line %d
string(120) "<wddxPacket version='1.0'><header/><data><struct><var name='foo'><string>bar</string></var></struct></data></wddxPacket>"

View File

@@ -15,11 +15,14 @@ print_r(wddx_deserialize($message));
print_r(wddx_deserialize($message));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
Array
(
[handle] => 0
)
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
Array
(
[handle] => 0

View File

@@ -53,7 +53,8 @@ function ptr2str($ptr)
}
?>
DONE
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
[0]=>
array(1) {

View File

@@ -26,6 +26,7 @@ var_dump($d);
?>
DONE
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
object(stdClass)#%d (1) {
["php_class_name"]=>
string(8) "stdClass"

View File

@@ -29,7 +29,8 @@ foreach($wddx as $k=>$v)
?>
DONE
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(2) {
[0]=>
string(8) "manhluat"

View File

@@ -10,6 +10,9 @@ var_dump($wddx);
var_dump(wddx_deserialize($wddx));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_serialize_value() is deprecated in %s on line %d
string(301) "<wddxPacket version='1.0'><header><comment>&lt;/comment&gt;&lt;/header&gt;&lt;data&gt;&lt;struct&gt;&lt;var name=&quot;php_class_name&quot;&gt;&lt;string&gt;stdClass&lt;/string&gt;&lt;/var&gt;&lt;/struct&gt;&lt;/data&gt;&lt;/wddxPacket&gt;</comment></header><data><string></string></data></wddxPacket>"
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
string(0) ""

View File

@@ -19,6 +19,7 @@ EOF;
$array = wddx_deserialize($xml);
var_dump($array);
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(0) {
}

View File

@@ -10,11 +10,22 @@ Bug #72564: wddx deserialization of boolean
}
?>
Done
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_serialize_value() is deprecated in %s on line %d
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
string(84) "<wddxPacket version='1.0'><header/><data><boolean value='true'/></data></wddxPacket>"
bool(true)
Deprecated: Function wddx_serialize_value() is deprecated in %s on line %d
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
string(85) "<wddxPacket version='1.0'><header/><data><boolean value='false'/></data></wddxPacket>"
bool(false)
Deprecated: Function wddx_serialize_value() is deprecated in %s on line %d
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
string(68) "<wddxPacket version='1.0'><header/><data><null/></data></wddxPacket>"
NULL
Done

View File

@@ -26,7 +26,8 @@ XML;
$array = wddx_deserialize($xml);
var_dump($array);
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
["aDateTime3"]=>
string(24) "2

View File

@@ -27,7 +27,8 @@ XML;
$array = wddx_deserialize($xml);
var_dump($array);
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
["aBinary"]=>
string(9) "µ‰¥¹…ÉFF"

View File

@@ -31,5 +31,6 @@ XML;
$array = wddx_deserialize($xml);
var_dump($array);
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
NULL

View File

@@ -24,5 +24,6 @@ XML;
$array = wddx_deserialize($xml);
var_dump($array);
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
NULL

View File

@@ -22,6 +22,7 @@ XML;
var_dump(wddx_deserialize($xml));
?>
DONE
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
NULL
DONE

View File

@@ -81,18 +81,27 @@ for($i=1;$i<=5;$i++) {
}
?>
DONE
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(0) {
}
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(0) {
}
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(0) {
}
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
[0]=>
array(0) {
}
}
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(0) {
}
DONE

View File

@@ -21,5 +21,6 @@ XML;
var_dump(wddx_deserialize($xml));
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
NULL

View File

@@ -9,5 +9,7 @@ $wddx = "<wddxPacket version='1.0'><header/><data><struct><var name='php_class_n
var_dump(wddx_deserialize($wddx));
?>
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
Warning: wddx_deserialize(): Class pdorow can not be unserialized in %s73331.php on line %d
NULL

View File

@@ -16,5 +16,6 @@ EOF;
$wddx = wddx_deserialize($xml);
var_dump($wddx);
?>
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
int(1234)

View File

@@ -13,6 +13,7 @@ setlocale(LC_NUMERIC , ['de_DE', 'de_DE.UTF-8', 'de-DE']);
var_dump(wddx_serialize_value(['foo' => 5.1]));
?>
===DONE===
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_serialize_value() is deprecated in %s on line %d
string(120) "<wddxPacket version='1.0'><header/><data><struct><var name='foo'><number>5.1</number></var></struct></data></wddxPacket>"
===DONE===

View File

@@ -19,5 +19,7 @@ try {
} catch(Error $e) { echo $e->getMessage(); }
?>
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
Warning: wddx_deserialize(): Class throwable can not be instantiated in %sbug73831.php on line %d
Cannot instantiate interface Throwable

View File

@@ -11,6 +11,7 @@ $wddx = wddx_deserialize($data);
var_dump($wddx);
?>
DONE
--EXPECT--
--EXPECTF--
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
NULL
DONE

View File

@@ -12,8 +12,10 @@ print strlen($wddx_str) . " bytes read.\n";
var_dump(wddx_deserialize($wddx_str));
?>
--EXPECT--
--EXPECTF--
323 bytes read.
Deprecated: Function wddx_deserialize() is deprecated in %s on line %d
array(1) {
["aDateTime"]=>
string(12) "frONt of 0 0"

View File

@@ -130,12 +130,12 @@ ZEND_END_ARG_INFO()
/* {{{ wddx_functions[]
*/
static const zend_function_entry wddx_functions[] = {
PHP_FE(wddx_serialize_value, arginfo_wddx_serialize_value)
PHP_FE(wddx_serialize_vars, arginfo_wddx_serialize_vars)
PHP_FE(wddx_packet_start, arginfo_wddx_serialize_start)
PHP_FE(wddx_packet_end, arginfo_wddx_packet_end)
PHP_FE(wddx_add_vars, arginfo_wddx_add_vars)
PHP_FE(wddx_deserialize, arginfo_wddx_deserialize)
PHP_DEP_FE(wddx_serialize_value, arginfo_wddx_serialize_value)
PHP_DEP_FE(wddx_serialize_vars, arginfo_wddx_serialize_vars)
PHP_DEP_FE(wddx_packet_start, arginfo_wddx_serialize_start)
PHP_DEP_FE(wddx_packet_end, arginfo_wddx_packet_end)
PHP_DEP_FE(wddx_add_vars, arginfo_wddx_add_vars)
PHP_DEP_FE(wddx_deserialize, arginfo_wddx_deserialize)
PHP_FE_END
};
/* }}} */

View File

@@ -21,8 +21,4 @@ constant('A::protectedConst');
string(14) "protectedConst"
string(14) "protectedConst"
Fatal error: Uncaught Error: Cannot access protected const A::protectedConst in %s:14
Stack trace:
#0 %s(14): constant('A::protectedCon...')
#1 {main}
thrown in %s on line 14
Warning: constant(): Couldn't find constant A::protectedConst in %s on line %d

View File

@@ -21,8 +21,4 @@ constant('A::privateConst');
string(12) "privateConst"
string(12) "privateConst"
Fatal error: Uncaught Error: Cannot access private const A::privateConst in %s:14
Stack trace:
#0 %s(14): constant('A::privateConst')
#1 {main}
thrown in %s on line 14
Warning: constant(): Couldn't find constant A::privateConst in %s on line %d

View File

@@ -0,0 +1,12 @@
--TEST--
Defined on private constant should not raise exception
--FILE--
<?php
class Foo
{
private const BAR = 1;
}
echo (int)defined('Foo::BAR');
--EXPECTF--
0

View File

@@ -72,7 +72,7 @@ PHP_WINUTIL_API void php_win32_signal_ctrl_handler_shutdown(void)
ZVAL_UNDEF(&ctrl_handler);
}/*}}}*/
static BOOL php_win32_signal_system_ctrl_handler(DWORD evt)
static BOOL WINAPI php_win32_signal_system_ctrl_handler(DWORD evt)
{/*{{{*/
if (CTRL_C_EVENT != evt && CTRL_BREAK_EVENT != evt) {
return FALSE;