Skip to content

Conversation

kakserpom
Copy link
Contributor

@kakserpom kakserpom commented Jun 17, 2025

Copy link
Collaborator

@Xenira Xenira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kakserpom thank you so much!

Didn't have a detailed look yet, but remembered that we have an ArrayKey enum. Might want to utilise it here.

@Xenira Xenira changed the title #453: ZendHashTable::insert(): cast numeric keys into zend_ulong fix(array): cast numeric keys into zend_ulong when inserting with string keys Jun 17, 2025
@Xenira Xenira changed the title fix(array): cast numeric keys into zend_ulong when inserting with string keys fix(array): cast numeric keys into zend_ulong when inserting string keys Jun 17, 2025
@kakserpom
Copy link
Contributor Author

PR solves both #453 and #454.

@Xenira
Copy link
Collaborator

Xenira commented Jun 20, 2025

@kakserpom Would you mind adding integration and unit tests?

@coveralls
Copy link

coveralls commented Jun 20, 2025

Pull Request Test Coverage Report for Build 16000972716

Details

  • 0 of 81 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 20.197%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/zend/handlers.rs 0 1 0.0%
src/types/array.rs 0 80 0.0%
Totals Coverage Status
Change from base Build 15999426440: -0.3%
Covered Lines: 760
Relevant Lines: 3763

💛 - Coveralls

This was linked to issues Jun 20, 2025
@Xenira
Copy link
Collaborator

Xenira commented Jun 20, 2025

@kakserpom just a hint for commit messages you can use convco

@kakserpom kakserpom force-pushed the 453_ZendHashTable_numeric_keys branch from d725728 to 6e1789e Compare June 20, 2025 18:18
@kakserpom
Copy link
Contributor Author

@Xenira Ordnung über alles? 😁

@Xenira
Copy link
Collaborator

Xenira commented Jun 20, 2025

@kakserpom keep it in english pls 😉

@kakserpom kakserpom mentioned this pull request Jun 27, 2025
@kakserpom kakserpom force-pushed the 453_ZendHashTable_numeric_keys branch 7 times, most recently from 7bf3255 to d528a4e Compare June 27, 2025 16:49
Copy link
Contributor

@Qard Qard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this needs a rebase and to get rid of the clippy bits now that the clippy updated PR merged. Other than that though, LGTM. 🙂

@kakserpom
Copy link
Contributor Author

@Qard done

Copy link
Contributor

@Qard Qard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about all the #[allow(clippy::mut_from_ref)] lines? Are those actually necessary?

@kakserpom
Copy link
Contributor Author

@Qard yes, otherwise Clippy shows warnings because of &self instead of &mut self in function signatures.

@Qard
Copy link
Contributor

Qard commented Jun 28, 2025

Ah, so it's intentional to leave it then? Just wanted to be sure we weren't just forgetting to un-silence clippy in some places it might have legitimate warnings. 😅

@kakserpom
Copy link
Contributor Author

Yes, It's intentional. I've enabled clippy::pedantic in another PR and quite a few warnings appeared, some of them led to actual fixes and some had to be silenced.

@Qard Qard mentioned this pull request Jun 28, 2025
Copy link
Contributor

@Qard Qard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clippy changes I guess aren't related to this PR, but necessary to get CI to pass, so that's fine.

Everything LGTM. Hopefully this can land soon to unblock other things. 🙂

@Xenira
Copy link
Collaborator

Xenira commented Jul 1, 2025

@kakserpom @Qard Regarding the clippy issues: Our usual procedure is to create a mr fixing those issues and rebase affected MRs. I have created one for the current issues, except the ones in #461, as those require some more investigation and possible breaking changes.

@kakserpom could you remove those ignores and rebase once #474 is merged?

@kakserpom kakserpom force-pushed the 453_ZendHashTable_numeric_keys branch from 08be145 to c511bd2 Compare July 1, 2025 12:45
Copy link
Collaborator

@Xenira Xenira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some small changes needed.

Could you also add integration tests for negative and 'string number' indices?

kakserpom

This comment was marked as outdated.

@kakserpom kakserpom force-pushed the 453_ZendHashTable_numeric_keys branch 2 times, most recently from 4e58912 to 1cdea5d Compare July 1, 2025 13:08
@kakserpom kakserpom force-pushed the 453_ZendHashTable_numeric_keys branch from 1cdea5d to 6989a08 Compare July 1, 2025 13:09
@kakserpom
Copy link
Contributor Author

kakserpom commented Jul 1, 2025

@Xenira

Could you also add integration tests for negative and 'string number' indices?

I'd rather someone else do it because I am on a trip until the end of the week. It's pretty trivial.

@Xenira
Copy link
Collaborator

Xenira commented Jul 1, 2025

I'd rather someone do it because I am on a trip until the end of the week. It's pretty trivial.

Sure, will add them :)

Xenira added 2 commits July 1, 2025 15:33
Github wont let me amend this, so here is a commit that hopefully gets squashed.

Refs: davidcole1340#453
@Xenira Xenira changed the title fix(array): cast numeric keys into zend_ulong when inserting string keys fix(array): cast numeric string keys into zend_ulong and allow negative keys Jul 1, 2025
@Xenira Xenira changed the title fix(array): cast numeric string keys into zend_ulong and allow negative keys fix(array): cast numeric string keys into zend_ulong and allow negative keys Jul 1, 2025
@Xenira Xenira merged commit c4fbd91 into davidcole1340:master Jul 1, 2025
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow negative array indices Funny business with zend_array
4 participants