From 497db8e1d8a6da4d1005bba07d76de994ae7a82d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 24 Aug 2020 11:43:47 +0200 Subject: [PATCH] fix for upcoming PHP 8 --- psr_log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/psr_log.c b/psr_log.c index 182da66..17b3246 100644 --- a/psr_log.c +++ b/psr_log.c @@ -101,7 +101,6 @@ static void php_psr_PsrLogAbstractLogger_log(const char * level_str, size_t leve zval * _this_zval = getThis(); zval * message; zval * context = NULL; - zend_class_entry * expected_ce = NULL; // PsrLogAbstractLogger_ce_ptr zval fname = {0}; zval fparams[3]; @@ -252,7 +251,11 @@ PHP_METHOD(PsrLogLoggerAwareTrait, setLogger) Z_PARAM_OBJECT_OF_CLASS(logger, PsrLogLoggerInterface_ce_ptr) ZEND_PARSE_PARAMETERS_END(); +#if PHP_VERSION_ID < 80000 zend_update_property(Z_OBJCE_P(_this_zval), _this_zval, "logger", sizeof("logger")-1, logger); +#else + zend_update_property(Z_OBJCE_P(_this_zval), Z_OBJ_P(_this_zval), "logger", sizeof("logger")-1, logger); +#endif } static zend_function_entry PsrLogLoggerAwareTrait_methods[] = {