Skip to content

Commit 49dfc14

Browse files
committed
chore(agent): remove obsolete code (15/17) (#1084)
This PR removes obsolete `PHP7` codeblocks. PR: 15/17
1 parent fd1b157 commit 49dfc14

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

agent/php_zval.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,9 @@ inline static zval* nr_php_zval_alloc(void) {
8282
*/
8383
inline static void nr_php_zval_free(zval** zv) {
8484
if ((NULL != zv) && (NULL != *zv)) {
85-
#ifdef PHP7
8685
zval_ptr_dtor(*zv);
8786
efree(*zv);
8887
*zv = NULL;
89-
#else
90-
zval_ptr_dtor(zv);
91-
*zv = NULL;
92-
#endif
9388
}
9489
}
9590

@@ -116,15 +111,9 @@ static inline int nr_php_is_zval_valid_bool(const zval* z) {
116111
return 0;
117112
}
118113

119-
#ifdef PHP7
120114
if ((IS_TRUE == Z_TYPE_P(z)) || (IS_FALSE == Z_TYPE_P(z))) {
121115
return 1;
122116
}
123-
#else
124-
if (IS_BOOL == Z_TYPE_P(z)) {
125-
return 1;
126-
}
127-
#endif /* PHP7 */
128117

129118
return 0;
130119
}
@@ -134,11 +123,9 @@ static inline int nr_php_is_zval_valid_resource(const zval* z) {
134123
return 0;
135124
}
136125

137-
#ifdef PHP7
138126
if (NULL == Z_RES_P(z)) {
139127
return 0;
140128
}
141-
#endif /* PHP7 */
142129

143130
return 1;
144131
}
@@ -156,15 +143,9 @@ static inline int nr_php_is_zval_valid_string(const zval* z) {
156143
return 0;
157144
}
158145

159-
#ifdef PHP7
160146
if (NULL == Z_STR_P(z)) {
161147
return 0;
162148
}
163-
#else
164-
if (Z_STRLEN_P(z) < 0) {
165-
return 0;
166-
}
167-
#endif /* PHP7 */
168149

169150
return 1;
170151
}
@@ -190,15 +171,13 @@ static inline int nr_php_is_zval_valid_object(const zval* z) {
190171
return 0;
191172
}
192173

193-
#ifdef PHP7
194174
/*
195175
* It's possible in PHP 7 to have a zval with type IS_OBJECT but a NULL
196176
* zend_object pointer.
197177
*/
198178
if (NULL == Z_OBJ_P(z)) {
199179
return 0;
200180
}
201-
#endif /* PHP7 */
202181

203182
return 1;
204183
}
@@ -241,12 +220,8 @@ static inline int nr_php_is_zval_valid_scalar(const zval* z) {
241220
}
242221

243222
switch (Z_TYPE_P(z)) {
244-
#ifdef PHP7
245223
case IS_TRUE:
246224
case IS_FALSE:
247-
#else
248-
case IS_BOOL:
249-
#endif
250225
case IS_LONG:
251226
case IS_DOUBLE:
252227
return 1;
@@ -332,19 +307,11 @@ static inline long nr_php_zval_object_id(const zval* zv) {
332307
static inline void nr_php_zval_str_len(zval* zv,
333308
const char* str,
334309
nr_string_len_t len) {
335-
#ifdef PHP7
336310
ZVAL_STRINGL(zv, str, len);
337-
#else
338-
ZVAL_STRINGL(zv, str, len, 1);
339-
#endif /* PHP7 */
340311
}
341312

342313
static inline void nr_php_zval_str(zval* zv, const char* str) {
343-
#ifdef PHP7
344314
nr_php_zval_str_len(zv, str, nr_strlen(str));
345-
#else
346-
ZVAL_STRING(zv, str, 1);
347-
#endif /* PHP7 */
348315
}
349316

350317
#if defined(__clang__) || (__GNUC__ > 4) \

0 commit comments

Comments
 (0)