Commit 3d8cb61f879 for php.net
commit 3d8cb61f879dd74d7c44eccdf1c572eb6d1c3860
Author: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Date: Sun Apr 5 05:32:47 2026 +0800
[skip ci] ext/intl: Fix various typo (GH-21615)
diff --git a/ext/intl/ERROR_CONVENTIONS.md b/ext/intl/ERROR_CONVENTIONS.md
index 432862afd68..4b29101a0a8 100644
--- a/ext/intl/ERROR_CONVENTIONS.md
+++ b/ext/intl/ERROR_CONVENTIONS.md
@@ -40,7 +40,7 @@ no way to pass ownership of the string without it being copied.
unless the error is due to bad arguments, in which case only the global error
should be set.
-Objects store an intl_error structed in their private data. For instance:
+Objects store an intl_error in their private data. For instance:
```c
typedef struct {
@@ -59,7 +59,7 @@ void intl_errors_set_code(intl_error* err, UErrorCode err_code);
void intl_errors_set(intl_error* err, UErrorCode code, char* msg, int copyMsg);
```
-by passing a pointer to the object's `intl_error` structed as the first parameter.
+by passing a pointer to the object's `intl_error` as the first parameter.
Node the extra `s` in the functions' names (`errors`, not `error`).
Static methods should only set the global error.
diff --git a/ext/intl/collator/collator_convert.cpp b/ext/intl/collator/collator_convert.cpp
index d4de15aa0b8..aa49661f8d7 100644
--- a/ext/intl/collator/collator_convert.cpp
+++ b/ext/intl/collator/collator_convert.cpp
@@ -289,7 +289,7 @@ U_CFUNC zval* collator_convert_string_to_double( zval* str, zval *rv )
/* {{{ collator_convert_string_to_number_if_possible
*
- * Convert string to numer.
+ * Convert string to number.
*
* @param zval* str String to convert.
*
diff --git a/ext/intl/collator/collator_sort.cpp b/ext/intl/collator/collator_sort.cpp
index 003d7f45a83..2f8685e61e3 100644
--- a/ext/intl/collator/collator_sort.cpp
+++ b/ext/intl/collator/collator_sort.cpp
@@ -380,7 +380,7 @@ U_CFUNC PHP_FUNCTION( collator_sort_with_sort_keys )
if( !hash || zend_hash_num_elements( hash ) == 0 )
RETURN_TRUE;
- /* Create bufers */
+ /* Create buffers */
sortKeyBuf = reinterpret_cast<char *>(ecalloc( sortKeyBufSize, sizeof( char ) ));
sortKeyIndxBuf = reinterpret_cast<collator_sort_key_index_t *>(ecalloc( sortKeyIndxBufSize, sizeof( uint8_t ) ));
utf16_buf = eumalloc( utf16_buf_size );
diff --git a/ext/intl/formatter/formatter_data.cpp b/ext/intl/formatter/formatter_data.cpp
index 095be92ed29..a9e48d0b14d 100644
--- a/ext/intl/formatter/formatter_data.cpp
+++ b/ext/intl/formatter/formatter_data.cpp
@@ -32,7 +32,7 @@ void formatter_data_init( formatter_data* nf_data )
/* }}} */
/* {{{ void formatter_data_free( formatter_data* nf_data )
- * Clean up mem allocted by internals of formatter_data
+ * Clean up mem allocated by internals of formatter_data
*/
void formatter_data_free( formatter_data* nf_data )
{
diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h
index 8a9bff0b271..d8d9fac97bf 100644
--- a/ext/intl/intl_error.h
+++ b/ext/intl/intl_error.h
@@ -37,7 +37,7 @@ void intl_error_set( intl_error* err, UErrorCode code, const char* msg);
UErrorCode intl_error_get_code( intl_error* err );
zend_string* intl_error_get_message( intl_error* err );
-// Wrappers to synchonize object's and global error structures.
+// Wrappers to synchronize object's and global error structures.
void intl_errors_reset( intl_error* err );
void intl_errors_set_custom_msg( intl_error* err, const char* msg);
void intl_errors_set_code( intl_error* err, UErrorCode err_code );
diff --git a/ext/intl/locale/locale_methods.cpp b/ext/intl/locale/locale_methods.cpp
index 8f09e5c116e..cff62b50339 100644
--- a/ext/intl/locale/locale_methods.cpp
+++ b/ext/intl/locale/locale_methods.cpp
@@ -254,7 +254,7 @@ static zend_off_t getStrrtokenPos(char* str, zend_off_t savedPos)
}
}
if(result < 1){
- /* Just in case inavlid locale e.g. '-x-xyz' or '-sl_Latn' */
+ /* Just in case invalid locale e.g. '-x-xyz' or '-sl_Latn' */
result =-1;
}
return result;
@@ -362,7 +362,7 @@ static zend_string* get_icu_value_internal( const char* loc_name , const char* t
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
return zend_string_init(loc_name, strlen(loc_name), 0);
} else {
- /* Since Grandfathered , no value , do nothing , retutn NULL */
+ /* Since Grandfathered , no value , do nothing , return NULL */
return NULL;
}
}
diff --git a/ext/intl/transliterator/transliterator_class.cpp b/ext/intl/transliterator/transliterator_class.cpp
index fd0cd4f3c3e..3525872d77f 100644
--- a/ext/intl/transliterator/transliterator_class.cpp
+++ b/ext/intl/transliterator/transliterator_class.cpp
@@ -80,7 +80,7 @@ static void transliterator_object_init( Transliterator_object* to )
/* }}} */
/* {{{ void transliterator_object_destroy( Transliterator_object* to )
- * Clean up mem allocted by internals of Transliterator_object
+ * Clean up mem allocated by internals of Transliterator_object
*/
static void transliterator_object_destroy( Transliterator_object* to )
{