]> granicus.if.org Git - php/commitdiff
avoid strlen usage in loop
authorAnatol Belski <ab@php.net>
Sat, 20 Sep 2014 18:05:27 +0000 (20:05 +0200)
committerAnatol Belski <ab@php.net>
Sat, 20 Sep 2014 18:05:27 +0000 (20:05 +0200)
ext/date/php_date.c

index a93afab59b4733fd61180b4a7b9920b176784226..3fd4b27eb30e2f13b2c2c18afa58adc8cbec5be9 100644 (file)
@@ -4496,12 +4496,12 @@ PHP_FUNCTION(timezone_abbreviations_list)
 
        do {
                array_init(&element);
-               add_assoc_bool(&element, "dst", entry->type);
-               add_assoc_long(&element, "offset", entry->gmtoffset);
+               add_assoc_bool_ex(&element, "dst", sizeof("dst") -1, entry->type);
+               add_assoc_long_ex(&element, "offset", sizeof("offset") - 1, entry->gmtoffset);
                if (entry->full_tz_name) {
-                       add_assoc_string(&element, "timezone_id", entry->full_tz_name);
+                       add_assoc_string_ex(&element, "timezone_id", sizeof("timezone_id") - 1, entry->full_tz_name);
                } else {
-                       add_assoc_null(&element, "timezone_id");
+                       add_assoc_null_ex(&element, "timezone_id", sizeof("timezone_id") - 1);
                }
 
                abbr_array_p = zend_hash_str_find(HASH_OF(return_value), entry->name, strlen(entry->name));