[pecl-networking-gearman] master: Merge pull request #62 from php/bug61

From: Date: Tue, 07 Apr 2026 12:29:24 +0000
Subject: [pecl-networking-gearman] master: Merge pull request #62 from php/bug61
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-28503@lists.php.net to get a copy of this message
Author: Rasmus Lerdorf (rlerdorf) Committer: GitHub (web-flow) Pusher: rlerdorf Date: 2026-04-07T13:29:21+01:00 Commit: https://github.com/php/pecl-networking-gearman/commit/34c8929e94769e17e0721bfa9200d72d827d07cd Raw diff: https://github.com/php/pecl-networking-gearman/commit/34c8929e94769e17e0721bfa9200d72d827d07cd.diff Merge pull request #62 from php/bug61 fixes #61 Changed paths: M php_gearman_worker.c Diff: diff --git a/php_gearman_worker.c b/php_gearman_worker.c index 342035e..bc9fbd1 100644 --- a/php_gearman_worker.c +++ b/php_gearman_worker.c @@ -613,6 +613,9 @@ static void *_php_worker_function_callback(gearman_job_st *job, if (EG(exception)) { zend_string *exc_msg; zval rv; +#if PHP_VERSION_ID < 80000 + zval exception_zv; +#endif ZVAL_UNDEF(&rv); *ret_ptr = GEARMAN_WORK_EXCEPTION; @@ -623,8 +626,14 @@ static void *_php_worker_function_callback(gearman_job_st *job, * class as scope so the protected message property is * accessible for all Throwable types (Error, TypeError, * etc.), not just Exception. See issue #21. */ +#if PHP_VERSION_ID < 80000 + ZVAL_OBJ(&exception_zv, EG(exception)); + exc_msg = zval_get_string(zend_read_property( + EG(exception)->ce, &exception_zv, "message", sizeof("message") - 1, 1, &rv)); +#else exc_msg = zval_get_string(zend_read_property( EG(exception)->ce, EG(exception), "message", sizeof("message") - 1, 1, &rv)); +#endif jobj->ret = gearman_job_send_exception(jobj->job, ZSTR_VAL(exc_msg), ZSTR_LEN(exc_msg));

« previous php.pecl.cvs (#28503) next »