Skip to content

Commit 5095e2f

Browse files
committed
zend_ini: mark zend_ini_string{_ex} as returning a const char*
1 parent a27c55c commit 5095e2f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

UPGRADING.INTERNALS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES
7070
performed on the result.
7171
. The zend_dval_to_lval_cap() function no longer takes a second
7272
zend_string* parameter.
73+
. The zend_ini_string{_ex} functions (and thus INI_STR() and INI_ORIG_STR()
74+
macros) now return a const char* instead of a char*.
7375

7476
========================
7577
2. Build system changes

Zend/zend_ini.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,15 @@ ZEND_API double zend_ini_double(const char *name, size_t name_length, int orig)
491491
}
492492
/* }}} */
493493

494-
ZEND_API char *zend_ini_string_ex(const char *name, size_t name_length, int orig, bool *exists) /* {{{ */
494+
ZEND_API const char *zend_ini_string_ex(const char *name, size_t name_length, int orig, bool *exists) /* {{{ */
495495
{
496496
zend_string *str = zend_ini_str_ex(name, name_length, orig, exists);
497497

498498
return str ? ZSTR_VAL(str) : NULL;
499499
}
500500
/* }}} */
501501

502-
ZEND_API char *zend_ini_string(const char *name, size_t name_length, int orig) /* {{{ */
502+
ZEND_API const char *zend_ini_string(const char *name, size_t name_length, int orig) /* {{{ */
503503
{
504504
zend_string *str = zend_ini_str(name, name_length, orig);
505505

Zend/zend_ini.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ ZEND_API void display_ini_entries(zend_module_entry *module);
8888

8989
ZEND_API zend_long zend_ini_long(const char *name, size_t name_length, int orig);
9090
ZEND_API double zend_ini_double(const char *name, size_t name_length, int orig);
91-
ZEND_API char *zend_ini_string(const char *name, size_t name_length, int orig);
92-
ZEND_API char *zend_ini_string_ex(const char *name, size_t name_length, int orig, bool *exists);
91+
ZEND_API const char *zend_ini_string(const char *name, size_t name_length, int orig);
92+
ZEND_API const char *zend_ini_string_ex(const char *name, size_t name_length, int orig, bool *exists);
9393
ZEND_API zend_string *zend_ini_str(const char *name, size_t name_length, bool orig);
9494
ZEND_API zend_string *zend_ini_str_ex(const char *name, size_t name_length, bool orig, bool *exists);
9595
ZEND_API zend_string *zend_ini_get_value(zend_string *name);

0 commit comments

Comments
 (0)