Skip to content

Commit f12e255

Browse files
committed
chore(agent): remove obsolete code (14/17) (#1083)
This PR removes obsolete `PHP7` codeblocks. PR: 14/17
1 parent a31167a commit f12e255

File tree

1 file changed

+6
-40
lines changed

1 file changed

+6
-40
lines changed

agent/php_wrapper.c

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -209,44 +209,21 @@ nruserfn_t* nr_php_wrap_generic_callable(zval* callable,
209209
}
210210

211211
inline static void release_zval(zval** ppzv) {
212-
#ifdef PHP7
213212
nr_php_zval_free(ppzv);
214-
#else
215-
if (NULL == ppzv) {
216-
return;
217-
}
218-
if (NULL == *ppzv) {
219-
return;
220-
}
221-
222-
zval_ptr_dtor(ppzv);
223-
*ppzv = NULL;
224-
#endif /* PHP7 */
225213
}
226214

227215
zval* nr_php_arg_get(ssize_t index, NR_EXECUTE_PROTO TSRMLS_DC) {
228216
zval* arg;
229217
NR_UNUSED_FUNC_RETURN_VALUE;
230-
#ifdef PHP7
231-
{
232-
zval* orig;
218+
zval* orig;
233219

234-
arg = NULL;
235-
orig = nr_php_get_user_func_arg((zend_uint)index, NR_EXECUTE_ORIG_ARGS);
220+
arg = NULL;
221+
orig = nr_php_get_user_func_arg((zend_uint)index, NR_EXECUTE_ORIG_ARGS);
236222

237-
if (orig) {
238-
arg = nr_php_zval_alloc();
239-
ZVAL_DUP(arg, orig);
240-
}
223+
if (orig) {
224+
arg = nr_php_zval_alloc();
225+
ZVAL_DUP(arg, orig);
241226
}
242-
#else
243-
arg = nr_php_get_user_func_arg((zend_uint)index,
244-
NR_EXECUTE_ORIG_ARGS TSRMLS_CC);
245-
246-
if (arg) {
247-
Z_ADDREF_P(arg);
248-
}
249-
#endif /* PHP7 */
250227

251228
return arg;
252229
}
@@ -360,15 +337,8 @@ zval* nr_php_scope_get(NR_EXECUTE_PROTO TSRMLS_DC) {
360337
return NULL;
361338
}
362339

363-
#ifdef PHP7
364340
this_copy = nr_php_zval_alloc();
365341
ZVAL_DUP(this_copy, this_obj);
366-
#else
367-
NR_UNUSED_SPECIALFN;
368-
369-
this_copy = this_obj;
370-
Z_ADDREF_P(this_copy);
371-
#endif
372342

373343
return this_copy;
374344
}
@@ -378,13 +348,9 @@ void nr_php_scope_release(zval** ppzv) {
378348
}
379349

380350
zval** nr_php_get_return_value_ptr(TSRMLS_D) {
381-
#ifdef PHP7
382351
if (NULL == EG(current_execute_data)) {
383352
return NULL;
384353
}
385354

386355
return &EG(current_execute_data)->return_value;
387-
#else
388-
return EG(return_value_ptr_ptr);
389-
#endif /* PHP7 */
390356
}

0 commit comments

Comments
 (0)