Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4.0 support #142

Open
wants to merge 22 commits into
base: fork
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- 8.1.26
- 8.2.13
- 8.3.0
- 8.4.0beta5

uses: ./.github/workflows/main-php-matrix.yml
with:
Expand Down
9 changes: 8 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ environment:
PHP_VER: 8.1
VC_VER: vs16
VCVARS_VER: ""
PHP_STABILITY: stable
- ARCH: x64
PHP_VER: 8.2
VC_VER: vs16
VCVARS_VER: ""
PHP_STABILITY: stable
- ARCH: x64
PHP_VER: 8.4
VC_VER: vs16
VCVARS_VER: ""
PHP_STABILITY: staging

install:
- cmd: cinst wget
Expand All @@ -35,7 +42,7 @@ build_script:

xcopy C:\projects\pmmpthread C:\projects\php-src\ext\pmmpthread /s /e /y /q

phpsdk_deps -u -t %VC_VER% -b %PHP_VER% -a %ARCH% -f -d C:\projects\php-src\deps
phpsdk_deps -u -t %VC_VER% -b %PHP_VER% -s %PHP_STABILITY% -a %ARCH% -f -d C:\projects\php-src\deps
dktapps marked this conversation as resolved.
Show resolved Hide resolved

wget http://www.mirrorservice.org/sites/sources.redhat.com/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip -q

Expand Down
4 changes: 4 additions & 0 deletions src/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ HashTable* pmmpthread_read_debug(PMMPTHREAD_READ_DEBUG_PASSTHRU_D) {
HashTable* pmmpthread_read_properties(PMMPTHREAD_READ_PROPERTIES_PASSTHRU_D) {
pmmpthread_zend_object_t* threaded = PMMPTHREAD_FETCH_FROM(object);

#if PHP_VERSION_ID >= 80400
zend_std_get_properties_ex(&threaded->std);
#else
rebuild_object_properties(&threaded->std);
#endif

pmmpthread_store_tohash(
&threaded->std, threaded->std.properties);
Expand Down
13 changes: 9 additions & 4 deletions src/prepare.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,16 @@ static zend_class_entry* pmmpthread_copy_entry(const pmmpthread_ident_t* source,
prepared->refcount = 1;

memcpy(&prepared->info.user, &candidate->info.user, sizeof(candidate->info.user));

if ((PMMPTHREAD_ZG(options) & PMMPTHREAD_INHERIT_COMMENTS) &&
(candidate->info.user.doc_comment)) {
prepared->info.user.doc_comment = pmmpthread_copy_string(candidate->info.user.doc_comment);
} else prepared->info.user.doc_comment = NULL;
#if PHP_VERSION_ID >= 80400
(candidate->doc_comment)) {
prepared->doc_comment = pmmpthread_copy_string(candidate->doc_comment);
} else prepared->doc_comment = NULL;
#else
(candidate->info.user.doc_comment)) {
prepared->info.user.doc_comment = pmmpthread_copy_string(candidate->info.user.doc_comment);
} else prepared->info.user.doc_comment = NULL;
#endif
AkmalFairuz marked this conversation as resolved.
Show resolved Hide resolved

if (candidate->attributes) {
prepared->attributes = pmmpthread_copy_attributes(source, candidate->attributes, prepared->info.user.filename);
Expand Down
6 changes: 5 additions & 1 deletion src/store.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ void pmmpthread_store_destroy(pmmpthread_store_t* store) {
/* {{{ Prepares local property table to cache items.
We may use integer keys, so the ht must be explicitly initialized to avoid zend allocating it as packed, which will cause assert failures. */
static void pmmpthread_store_init_local_properties(zend_object* object) {
#if PHP_VERSION_ID >= 80400
zend_std_get_properties_ex(object);
#else
rebuild_object_properties(object);
#endif
if (HT_FLAGS(object->properties) & HASH_FLAG_UNINITIALIZED) {
zend_hash_real_init_mixed(object->properties);
}
Expand Down Expand Up @@ -143,7 +147,7 @@ static inline zend_bool pmmpthread_store_retain_in_local_cache(zval* val) {
}

static inline zend_bool pmmpthread_store_valid_local_cache_item(zval* val) {
//rebuild_object_properties() may add IS_INDIRECT zvals to point to the linear property table
//zend_std_get_properties_ex() may add IS_INDIRECT zvals to point to the linear property table
//we don't want that, because they aren't used by pmmpthread and are always uninitialized
return Z_TYPE_P(val) != IS_INDIRECT;
}
Expand Down
Loading