Skip to content

Commit 4d6c7bd

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 8731c95 + 7f771e1 commit 4d6c7bd

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

ext/intl/locale/locale_methods.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ static int append_key_value(smart_str* loc_name, HashTable* hash_arr, char* key_
807807
{
808808
zval *ele_value;
809809

810-
if ((ele_value = zend_hash_str_find(hash_arr , key_name, strlen(key_name))) != NULL ) {
810+
if ((ele_value = zend_hash_str_find_deref(hash_arr , key_name, strlen(key_name))) != NULL ) {
811811
if(Z_TYPE_P(ele_value)!= IS_STRING ){
812812
/* element value is not a string */
813813
return FAILURE;
@@ -850,7 +850,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
850850
int isFirstSubtag = 0;
851851

852852
/* Variant/ Extlang/Private etc. */
853-
if ((ele_value = zend_hash_str_find( hash_arr , key_name , strlen(key_name))) != NULL) {
853+
if ((ele_value = zend_hash_str_find_deref( hash_arr , key_name , strlen(key_name))) != NULL) {
854854
if( Z_TYPE_P(ele_value) == IS_STRING ){
855855
add_prefix( loc_name , key_name);
856856

@@ -862,6 +862,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
862862
zval *data;
863863

864864
ZEND_HASH_FOREACH_VAL(arr, data) {
865+
ZVAL_DEREF(data);
865866
if(Z_TYPE_P(data) != IS_STRING) {
866867
return FAILURE;
867868
}
@@ -893,7 +894,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
893894
isFirstSubtag = 0;
894895
for( i=0 ; i< max_value; i++ ){
895896
snprintf( cur_key_name , 30, "%s%d", key_name , i);
896-
if ((ele_value = zend_hash_str_find( hash_arr , cur_key_name , strlen(cur_key_name))) != NULL) {
897+
if ((ele_value = zend_hash_str_find_deref( hash_arr , cur_key_name , strlen(cur_key_name))) != NULL) {
897898
if( Z_TYPE_P(ele_value)!= IS_STRING ){
898899
/* variant is not a string */
899900
return FAILURE;
@@ -1426,6 +1427,7 @@ static zend_string* lookup_loc_range(const char* loc_range, HashTable* hash_arr,
14261427

14271428
char **cur_arr = ecalloc(zend_hash_num_elements(hash_arr)*2, sizeof(char *));
14281429
ZEND_HASH_FOREACH_VAL(hash_arr, ele_value) {
1430+
ZVAL_DEREF(ele_value);
14291431
/* convert the array to lowercase , also replace hyphens with the underscore and store it in cur_arr */
14301432
if(Z_TYPE_P(ele_value)!= IS_STRING) {
14311433
/* element value is not a string */
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
locale_compose()/locale_lookup() with values as references.
3+
--EXTENSIONS--
4+
intl
5+
--FILE--
6+
<?php
7+
8+
$en = 'en';
9+
$data = [Locale::LANG_TAG => 'en', Locale::REGION_TAG => &$en];
10+
11+
var_dump(locale_compose($data));
12+
13+
$data = [
14+
'language' => 'de',
15+
'script' => 'Hans',
16+
'region' => 'DE',
17+
'variant2' => 'fr',
18+
'variant1' => &$en,
19+
'private1' => 'private1',
20+
'private2' => 'private2',
21+
];
22+
var_dump(locale_compose($data));
23+
$data = ['de', &$en];
24+
var_dump(locale_lookup($data, "en", false, "en"));
25+
?>
26+
--EXPECT--
27+
string(5) "en_en"
28+
string(36) "de_Hans_DE_en_fr_x_private1_private2"
29+
string(2) "en"

main/php_version.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
/* automatically generated by configure */
22
/* edit configure.ac to change version number */
33
#define PHP_MAJOR_VERSION 8
4+
<<<<<<< HEAD
45
#define PHP_MINOR_VERSION 5
56
#define PHP_RELEASE_VERSION 0
67
#define PHP_EXTRA_VERSION "-dev"
78
#define PHP_VERSION "8.5.0-dev"
89
#define PHP_VERSION_ID 80500
10+
=======
11+
#define PHP_MINOR_VERSION 4
12+
#define PHP_RELEASE_VERSION 6
13+
#define PHP_EXTRA_VERSION "-dev"
14+
#define PHP_VERSION "8.4.6-dev"
15+
#define PHP_VERSION_ID 80406
16+
>>>>>>> PHP-8.4

0 commit comments

Comments
 (0)