Skip to content

[k2] implicit conversion to string of replace params#1504

Merged
Shamzik merged 4 commits intomasterfrom
kshamazov/regex_replace_fix
Jan 16, 2026
Merged

[k2] implicit conversion to string of replace params#1504
Shamzik merged 4 commits intomasterfrom
kshamazov/regex_replace_fix

Conversation

@Shamzik
Copy link
Contributor

@Shamzik Shamzik commented Jan 15, 2026

The preg_replace/preg_replace_callback functions accept parameters of type string|array. This PR adds implicit conversion from other non-object types to the string type.

@Shamzik Shamzik added this to the next milestone Jan 15, 2026
@Shamzik Shamzik requested a review from apolyakov January 15, 2026 10:47
@Shamzik Shamzik self-assigned this Jan 15, 2026
@Shamzik Shamzik added small fix When it's not an huge enhancement k2 k2 related labels Jan 15, 2026
@Shamzik Shamzik marked this pull request as ready for review January 15, 2026 11:21
@Shamzik Shamzik changed the title [k2] cast to string replace params if possible [k2] implicit conversion to string of replace params Jan 15, 2026
@Shamzik Shamzik requested a review from apolyakov January 15, 2026 15:59
Copy link
Contributor

@apolyakov apolyakov left a comment

Choose a reason for hiding this comment

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

LGTM

@Shamzik Shamzik merged commit 06291e5 into master Jan 16, 2026
7 checks passed
@Shamzik Shamzik deleted the kshamazov/regex_replace_fix branch January 16, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

k2 k2 related small fix When it's not an huge enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants