Skip to content

Commit 9464082

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents e96a35b + f34859c commit 9464082

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

ext/intl/dateformat/dateformat_format.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
6464
return result;
6565
}
6666

67-
if ((ele_value = zend_hash_str_find(hash_arr, key_name, strlen(key_name))) != NULL) {
67+
if ((ele_value = zend_hash_str_find_deref(hash_arr, key_name, strlen(key_name))) != NULL) {
6868
if(Z_TYPE_P(ele_value) != IS_LONG) {
6969
spprintf(&message, 0, "datefmt_format: parameter array contains "
7070
"a non-integer element for key '%s'", key_name);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Fix dateformat_format() with array argument with values as references.
3+
--SKIPIF--
4+
<?php
5+
if (PHP_OS_FAMILY === "Windows") die("skip currently unsupported on Windows");
6+
?>
7+
--FILE--
8+
<?php
9+
$a = 24;
10+
$localtime_arr = array (
11+
'tm_sec' => &$a ,
12+
'tm_min' => 3,
13+
'tm_hour' => 19,
14+
'tm_mday' => 3,
15+
'tm_mon' => 3,
16+
'tm_year' => 105,
17+
);
18+
$fmt = datefmt_create('en_US', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/New_York', IntlDateFormatter::GREGORIAN);
19+
$formatted = datefmt_format($fmt , $localtime_arr);
20+
var_dump($formatted);
21+
?>
22+
--EXPECTF--
23+
string(%d) "Sunday, April 3, 2005 at 7:03:24%aPM Eastern Daylight Time"

0 commit comments

Comments
 (0)