Skip to content

Conversation

@GromNaN
Copy link
Contributor

@GromNaN GromNaN commented Sep 28, 2023

I did some benchmarks. in_array vs preg_replace approaches are almost identical in terms of performance (very fast). Got the simplest implementation with explode, in_array and array_diff.

@dg
Copy link
Member

dg commented Sep 29, 2023

Thanks

@dg dg merged commit 86d00d7 into nette:master Sep 29, 2023
dg pushed a commit that referenced this pull request Sep 29, 2023
@dg
Copy link
Member

dg commented Sep 29, 2023

I've tweaked it a bit, to make it work case insensitive, because theoretically you can write Null or NULL in PHP, and to throw an exception on intersection type.

dg pushed a commit that referenced this pull request Sep 29, 2023
dg pushed a commit that referenced this pull request Sep 29, 2023
@GromNaN GromNaN deleted the null-union branch September 29, 2023 13:21
dg pushed a commit that referenced this pull request Oct 15, 2023
dg pushed a commit that referenced this pull request Oct 17, 2023
dg pushed a commit that referenced this pull request Oct 17, 2023
dg pushed a commit that referenced this pull request Oct 29, 2023
dg pushed a commit that referenced this pull request Oct 29, 2023
dg pushed a commit that referenced this pull request Oct 29, 2023
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.

Nullable union type

2 participants