Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-de
On MacOS, you can install these using `brew`:

```shell
brew install autoconf bison re2c iconv libxml2 sqlite
brew install autoconf bison re2c libiconv libxml2 sqlite
```

or with `MacPorts`:
Expand Down
12 changes: 11 additions & 1 deletion build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,17 @@ AC_DEFUN([PHP_SETUP_ICONV], [

dnl Check external libs for iconv funcs.
AS_VAR_IF([found_iconv], [no], [
for i in $PHP_ICONV /usr/local /usr; do

dnl Find /opt/homebrew/opt/libiconv on macOS
dnl See: https://github.com/php/php-src/pull/19475
php_brew_prefix=no
AC_CHECK_PROG([BREW], [brew], [brew])
if test -n "$BREW"; then
AC_MSG_CHECKING([for homebrew prefix])
php_brew_prefix=$($BREW --prefix 2> /dev/null)
fi

for i in $PHP_ICONV $php_brew_prefix/opt/libiconv /usr/local /usr; do
if test -r $i/include/gnu-libiconv/iconv.h; then
ICONV_DIR=$i
ICONV_INCLUDE_DIR=$i/include/gnu-libiconv
Expand Down
15 changes: 13 additions & 2 deletions ext/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,15 +1178,26 @@ static void mhash_init(INIT_FUNC_ARGS)
int len;
int algo_number = 0;

zend_string *deprecation_reason = zend_string_init("as the mhash*() functions were deprecated", strlen("as the mhash*() functions were deprecated"), 1);
for (algo_number = 0; algo_number < MHASH_NUM_ALGOS; algo_number++) {
struct mhash_bc_entry algorithm = mhash_to_hash[algo_number];
if (algorithm.mhash_name == NULL) {
continue;
}

len = slprintf(buf, 127, "MHASH_%s", algorithm.mhash_name);
zend_register_long_constant(buf, len, algorithm.value, CONST_PERSISTENT|CONST_DEPRECATED, module_number);
}
zend_constant *mhash_const = zend_register_long_constant(buf, len, algorithm.value, CONST_PERSISTENT|CONST_DEPRECATED, module_number);

zend_attribute *deprecation_attrib = zend_add_global_constant_attribute(mhash_const, ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2);
ZVAL_STR(&deprecation_attrib->args[0].value, ZSTR_KNOWN(ZEND_STR_8_DOT_5));
deprecation_attrib->args[0].name = ZSTR_KNOWN(ZEND_STR_SINCE);
ZVAL_STR_COPY(&deprecation_attrib->args[1].value, deprecation_reason);
deprecation_attrib->args[1].name = ZSTR_KNOWN(ZEND_STR_MESSAGE);
}
/* Each of the attributes uses ZVAL_STR_COPY instead of trying to special
* case one of them to use ZVAL_STR, but that means there is one more
* reference that needs to be decremented. */
zend_string_release(deprecation_reason);

/* TODO: this cause #69823 zend_register_internal_module(&mhash_module_entry); */
}
Expand Down
22 changes: 11 additions & 11 deletions ext/hash/tests/mhash_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,77 +35,77 @@ foreach ($supported_hash_al as $hash=>$wanted) {
}
?>
--EXPECTF--
Deprecated: Constant MHASH_MD5 is deprecated in %s on line %d
Deprecated: Constant MHASH_MD5 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_MD5
ok


Deprecated: Constant MHASH_SHA1 is deprecated in %s on line %d
Deprecated: Constant MHASH_SHA1 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_SHA1
ok


Deprecated: Constant MHASH_HAVAL256 is deprecated in %s on line %d
Deprecated: Constant MHASH_HAVAL256 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_HAVAL256
ok


Deprecated: Constant MHASH_HAVAL192 is deprecated in %s on line %d
Deprecated: Constant MHASH_HAVAL192 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_HAVAL192
ok


Deprecated: Constant MHASH_HAVAL224 is deprecated in %s on line %d
Deprecated: Constant MHASH_HAVAL224 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_HAVAL224
ok


Deprecated: Constant MHASH_HAVAL160 is deprecated in %s on line %d
Deprecated: Constant MHASH_HAVAL160 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_HAVAL160
ok


Deprecated: Constant MHASH_RIPEMD160 is deprecated in %s on line %d
Deprecated: Constant MHASH_RIPEMD160 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_RIPEMD160
ok


Deprecated: Constant MHASH_GOST is deprecated in %s on line %d
Deprecated: Constant MHASH_GOST is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_GOST
ok


Deprecated: Constant MHASH_TIGER is deprecated in %s on line %d
Deprecated: Constant MHASH_TIGER is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_TIGER
ok


Deprecated: Constant MHASH_CRC32 is deprecated in %s on line %d
Deprecated: Constant MHASH_CRC32 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_CRC32
ok


Deprecated: Constant MHASH_CRC32B is deprecated in %s on line %d
Deprecated: Constant MHASH_CRC32B is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
MHASH_CRC32B
Expand Down
22 changes: 11 additions & 11 deletions ext/hash/tests/mhash_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,77 +35,77 @@ foreach ($supported_hash_al as $hash=>$wanted) {
}
?>
--EXPECTF--
Deprecated: Constant MHASH_MD5 is deprecated in %s on line %d
Deprecated: Constant MHASH_MD5 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_MD5
ok


Deprecated: Constant MHASH_SHA1 is deprecated in %s on line %d
Deprecated: Constant MHASH_SHA1 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_SHA1
ok


Deprecated: Constant MHASH_HAVAL256 is deprecated in %s on line %d
Deprecated: Constant MHASH_HAVAL256 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_HAVAL256
ok


Deprecated: Constant MHASH_HAVAL224 is deprecated in %s on line %d
Deprecated: Constant MHASH_HAVAL224 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_HAVAL224
ok


Deprecated: Constant MHASH_HAVAL192 is deprecated in %s on line %d
Deprecated: Constant MHASH_HAVAL192 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_HAVAL192
ok


Deprecated: Constant MHASH_HAVAL160 is deprecated in %s on line %d
Deprecated: Constant MHASH_HAVAL160 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_HAVAL160
ok


Deprecated: Constant MHASH_RIPEMD160 is deprecated in %s on line %d
Deprecated: Constant MHASH_RIPEMD160 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_RIPEMD160
ok


Deprecated: Constant MHASH_GOST is deprecated in %s on line %d
Deprecated: Constant MHASH_GOST is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_GOST
ok


Deprecated: Constant MHASH_TIGER is deprecated in %s on line %d
Deprecated: Constant MHASH_TIGER is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_TIGER
ok


Deprecated: Constant MHASH_CRC32 is deprecated in %s on line %d
Deprecated: Constant MHASH_CRC32 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_CRC32
ok


Deprecated: Constant MHASH_CRC32B is deprecated in %s on line %d
Deprecated: Constant MHASH_CRC32B is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d

Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d
MHASH_CRC32B
Expand Down
2 changes: 1 addition & 1 deletion ext/hash/tests/mhash_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var_dump($algo);

?>
--EXPECTF--
Deprecated: Constant MHASH_MD5 is deprecated in %s on line %d
Deprecated: Constant MHASH_MD5 is deprecated since 8.5, as the mhash*() functions were deprecated in %s on line %d
int(1)

Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d
Expand Down
3 changes: 1 addition & 2 deletions ext/intl/common/common.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,10 @@
*/
const U_MULTIPLE_DECIMAL_SEPARATORS = UNKNOWN;
/**
* Typo: kept for backward compatibility. Use U_MULTIPLE_DECIMAL_SEPARATORS
* @var int
* @deprecated
* @cvalue U_MULTIPLE_DECIMAL_SEPERATORS
*/
#[\Deprecated(since: '8.3', message: 'use U_MULTIPLE_DECIMAL_SEPARATORS instead')]
const U_MULTIPLE_DECIMAL_SEPERATORS = UNKNOWN;
/**
* @var int
Expand Down
12 changes: 10 additions & 2 deletions ext/intl/common/common_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ext/intl/common/common_enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
// Fix build on Windows/old versions of ICU
#include <stdio.h>

extern "C" {
#include <zend_attributes.h>
}

#include "common_enum.h"
#include "common_arginfo.h"

Expand Down
15 changes: 15 additions & 0 deletions ext/intl/tests/deprecated_U_MULTIPLE_DECIMAL_SEPERATORS.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
U_MULTIPLE_DECIMAL_SEPERATORS is deprecated
--EXTENSIONS--
intl
--FILE--
<?php
var_dump(U_MULTIPLE_DECIMAL_SEPERATORS);
var_dump(constant('U_MULTIPLE_DECIMAL_SEPERATORS'));
?>
--EXPECTF--
Deprecated: Constant U_MULTIPLE_DECIMAL_SEPERATORS is deprecated since 8.3, use U_MULTIPLE_DECIMAL_SEPARATORS instead in %s on line %d
int(65793)

Deprecated: Constant U_MULTIPLE_DECIMAL_SEPERATORS is deprecated since 8.3, use U_MULTIPLE_DECIMAL_SEPARATORS instead in %s on line %d
int(65793)
12 changes: 6 additions & 6 deletions ext/reflection/php_reflection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ static void reflection_attribute_factory(zval *object, HashTable *attributes, ze
}
/* }}} */

static int read_attributes(zval *ret, HashTable *attributes, zend_class_entry *scope,
static zend_result read_attributes(zval *ret, HashTable *attributes, zend_class_entry *scope,
uint32_t offset, uint32_t target, zend_string *name, zend_class_entry *base, zend_string *filename) /* {{{ */
{
ZEND_ASSERT(attributes != NULL);
Expand Down Expand Up @@ -1653,7 +1653,7 @@ static void reflection_enum_case_factory(zend_class_entry *ce, zend_string *name
ZVAL_STR_COPY(reflection_prop_class(object), constant->ce->name);
}

static int get_parameter_default(zval *result, parameter_reference *param) {
static zend_result get_parameter_default(zval *result, parameter_reference *param) {
if (param->fptr->type == ZEND_INTERNAL_FUNCTION) {
if (param->fptr->common.fn_flags & ZEND_ACC_USER_ARG_INFO) {
/* We don't have a way to determine the default value for this case right now. */
Expand Down Expand Up @@ -4523,16 +4523,16 @@ ZEND_METHOD(ReflectionClass, getMethod)
static bool _addmethod(zend_function *mptr, zend_class_entry *ce, HashTable *ht, zend_long filter)
{
if ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) && mptr->common.scope != ce) {
return 0;
return false;
}

if (mptr->common.fn_flags & filter) {
zval method;
reflection_method_factory(ce, mptr, NULL, &method);
zend_hash_next_index_insert_new(ht, &method);
return 1;
return true;
}
return 0;
return false;
}
/* }}} */

Expand Down Expand Up @@ -7100,7 +7100,7 @@ ZEND_METHOD(ReflectionReference, __construct)

static bool is_ignorable_reference(HashTable *ht, zval *ref) {
if (Z_REFCOUNT_P(ref) != 1) {
return 0;
return false;
}

/* Directly self-referential arrays are treated as proper references
Expand Down
Loading