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 all 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
2 changes: 1 addition & 1 deletion .github/workflows/main-php-matrix-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
default: 'windows-2019'

env:
PHP_SDK_BINARY_TOOLS_VER: 2.2.0
PHP_SDK_BINARY_TOOLS_VER: 2.3.0
PTHREAD_W32_VER: 3.0.0

jobs:
Expand Down
8 changes: 8 additions & 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.30
- 8.2.25
- 8.3.13
- 8.4.0RC4

uses: ./.github/workflows/main-php-matrix.yml
with:
Expand All @@ -29,13 +30,20 @@ jobs:
include:
- php: 8.1.30
vs-crt: vs16
runs-on: windows-2019
- php: 8.2.25
vs-crt: vs16
runs-on: windows-2019
- php: 8.3.13
vs-crt: vs16
runs-on: windows-2019
- php: 8.4.0RC4
vs-crt: vs17
runs-on: windows-2022 #duct tape until we can get vs16 on 2022 image

uses: ./.github/workflows/main-php-matrix-windows.yml
with:
php: ${{ matrix.php }}
vs-crt: ${{ matrix.vs-crt }}
runs-on: ${{ matrix.runs-on }}
secrets: inherit
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