@@ -280,11 +280,7 @@ PHP_FUNCTION(newrelic_exception_handler) {
280
280
* that we can use to do this, rather than having to replicate that logic
281
281
* ourselves.
282
282
*/
283
- #ifdef PHP7
284
283
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 */
288
284
}
289
285
290
286
/* 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) {
347
343
* handler installed and this function is called, we'll handle that case
348
344
* anyway in case another extension is trying to do the same thing.
349
345
*/
350
- #ifdef PHP7
351
346
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 */
355
347
356
348
if (has_user_exception_handler ) {
357
349
nrl_verbosedebug (NRL_ERROR ,
@@ -365,24 +357,14 @@ void nr_php_error_install_exception_handler(TSRMLS_D) {
365
357
* user_exception_handlers stack. We don't need to copy it: ownership of
366
358
* the pointer simply passes from executor_globals to the stack.
367
359
*/
368
- #ifdef PHP7
369
360
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 */
374
361
}
375
362
376
363
/*
377
364
* Actually allocate and set the user_exception_handler zval. PHP itself
378
365
* will destroy this at the end of the request.
379
366
*/
380
- #ifdef PHP7
381
367
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
386
368
}
387
369
388
370
/*
@@ -840,9 +822,5 @@ nr_status_t nr_php_error_record_exception_segment(nrtxn_t* txn,
840
822
}
841
823
842
824
int nr_php_error_zval_is_exception (zval * zv TSRMLS_DC ) {
843
- #ifdef PHP7
844
825
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 */
848
826
}
0 commit comments