Skip to content

Commit 1e49b53

Browse files
committed
chore(agent): remove obsolete code (6/17) (#1075)
This PR removes obsolete `PHP7` codeblocks. PR: 6/17
1 parent 48fa8f6 commit 1e49b53

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

agent/php_error.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,7 @@ PHP_FUNCTION(newrelic_exception_handler) {
280280
* that we can use to do this, rather than having to replicate that logic
281281
* ourselves.
282282
*/
283-
#ifdef PHP7
284283
zend_exception_error(Z_OBJ_P(exception), E_ERROR TSRMLS_CC);
285-
#else
286-
zend_exception_error(exception, E_ERROR TSRMLS_CC);
287-
#endif /* PHP7 */
288284
}
289285

290286
/* PHP Fatal errors: E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR |
@@ -347,11 +343,7 @@ void nr_php_error_install_exception_handler(TSRMLS_D) {
347343
* handler installed and this function is called, we'll handle that case
348344
* anyway in case another extension is trying to do the same thing.
349345
*/
350-
#ifdef PHP7
351346
has_user_exception_handler = (IS_UNDEF != Z_TYPE(EG(user_exception_handler)));
352-
#else
353-
has_user_exception_handler = (NULL != EG(user_exception_handler));
354-
#endif /* PHP7 */
355347

356348
if (has_user_exception_handler) {
357349
nrl_verbosedebug(NRL_ERROR,
@@ -365,24 +357,14 @@ void nr_php_error_install_exception_handler(TSRMLS_D) {
365357
* user_exception_handlers stack. We don't need to copy it: ownership of
366358
* the pointer simply passes from executor_globals to the stack.
367359
*/
368-
#ifdef PHP7
369360
zend_stack_push(&EG(user_exception_handlers), &EG(user_exception_handler));
370-
#else
371-
zend_ptr_stack_push(&EG(user_exception_handlers),
372-
EG(user_exception_handler));
373-
#endif /* PHP7 */
374361
}
375362

376363
/*
377364
* Actually allocate and set the user_exception_handler zval. PHP itself
378365
* will destroy this at the end of the request.
379366
*/
380-
#ifdef PHP7
381367
nr_php_zval_str(&EG(user_exception_handler), "newrelic_exception_handler");
382-
#else
383-
ALLOC_INIT_ZVAL(EG(user_exception_handler));
384-
nr_php_zval_str(EG(user_exception_handler), "newrelic_exception_handler");
385-
#endif
386368
}
387369

388370
/*
@@ -840,9 +822,5 @@ nr_status_t nr_php_error_record_exception_segment(nrtxn_t* txn,
840822
}
841823

842824
int nr_php_error_zval_is_exception(zval* zv TSRMLS_DC) {
843-
#ifdef PHP7
844825
return nr_php_object_instanceof_class(zv, "Throwable" TSRMLS_CC);
845-
#else
846-
return nr_php_object_instanceof_class(zv, "Exception" TSRMLS_CC);
847-
#endif /* PHP7 */
848826
}

0 commit comments

Comments
 (0)