Skip to content

Commit db68f7d

Browse files
committed
chore(agent): remove obsolete code (9/17) (#1078)
This PR removes obsolete `PHP7` codeblocks. PR: 9/17
1 parent a8c2172 commit db68f7d

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

agent/php_hash.h

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ nr_php_zend_hash_key_is_string(const zend_hash_key* hash_key) {
2929
return 0;
3030
}
3131

32-
#ifdef PHP7
3332
return (NULL != hash_key->key);
34-
#else
35-
return ((NULL != hash_key->arKey) && (0 != hash_key->nKeyLength));
36-
#endif /* PHP7 */
3733
}
3834

3935
static inline int NRPURE
@@ -56,11 +52,7 @@ nr_php_zend_hash_key_string_len(const zend_hash_key* hash_key) {
5652
return 0;
5753
}
5854

59-
#ifdef PHP7
6055
return hash_key->key ? hash_key->key->len : 0;
61-
#else
62-
return (nr_string_len_t)NRSAFELEN(hash_key->nKeyLength);
63-
#endif
6456
}
6557

6658
static inline const char* NRPURE
@@ -69,11 +61,7 @@ nr_php_zend_hash_key_string_value(const zend_hash_key* hash_key) {
6961
return NULL;
7062
}
7163

72-
#ifdef PHP7
7364
return hash_key->key ? hash_key->key->val : NULL;
74-
#else
75-
return hash_key->arKey;
76-
#endif
7765
}
7866

7967
/*
@@ -84,7 +72,6 @@ nr_php_zend_hash_key_string_value(const zend_hash_key* hash_key) {
8472
* Strings will always be duplicated, since that's non-optional in
8573
* PHP 7 anyway.
8674
*/
87-
#ifdef PHP7
8875
#define nr_php_add_assoc_string(ht, key, str) \
8976
add_assoc_string((ht), (key), (str))
9077

@@ -95,19 +82,6 @@ nr_php_zend_hash_key_string_value(const zend_hash_key* hash_key) {
9582

9683
#define nr_php_add_next_index_stringl(ht, str, strlen) \
9784
add_next_index_stringl((ht), (str), (strlen))
98-
#else
99-
#define nr_php_add_assoc_string(ht, key, str) \
100-
add_assoc_string((ht), (key), (str), 1)
101-
102-
#define nr_php_add_assoc_stringl(ht, key, str, strlen) \
103-
add_assoc_stringl((ht), (key), (str), (strlen), 1)
104-
105-
#define nr_php_add_next_index_string(ht, str) \
106-
add_next_index_string((ht), (str), 1)
107-
108-
#define nr_php_add_next_index_stringl(ht, str, strlen) \
109-
add_next_index_stringl((ht), (str), (strlen), 1)
110-
#endif /* PHP7 */
11185

11286
/*
11387
* Purpose : Wrap add_assoc_zval to ensure consistent ownership behaviour.
@@ -164,28 +138,11 @@ static inline int nr_php_add_assoc_zval(zval* arr,
164138
static inline int nr_php_add_index_zval(zval* arr,
165139
zend_ulong index,
166140
zval* value) {
167-
#ifdef PHP7
168141
zval copy;
169142

170143
ZVAL_DUP(&copy, value);
171144

172145
return add_index_zval(arr, index, &copy);
173-
#else
174-
zval* copy;
175-
176-
ALLOC_ZVAL(copy);
177-
INIT_PZVAL(copy);
178-
179-
/*
180-
* When we drop support for PHP 5.3, we can just use ZVAL_COPY_VALUE here.
181-
*/
182-
copy->value = value->value;
183-
Z_TYPE_P(copy) = Z_TYPE_P(value);
184-
185-
zval_copy_ctor(copy);
186-
187-
return add_index_zval(arr, index, copy);
188-
#endif /* PHP7 */
189146
}
190147

191148
typedef int (*nr_php_ptr_apply_t)(void* value,

0 commit comments

Comments
 (0)