History log of /PHP-8.2/ext/standard/string.c (Results 1 – 25 of 1171)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 631bc816 06-Feb-2024 Ilija Tovilo

Implement stackless internal function calls

Co-authored-by: Dmitry Stogov <dmitry@zend.com>

Closes GH-12461


# 927adfb1 20-Dec-2023 Cristian Rodríguez

Use a single version of mempcpy(3) (#12257)

While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_memp

Use a single version of mempcpy(3) (#12257)

While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_mempcpy, adds zend_mempcpy and transforms
open-coded parts into function calls.

show more ...


# e7896638 11-Dec-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Remove always-false condition from substr_replace()

l < 0 is checked before and set to a different value.


# f1af7223 01-Dec-2023 Vinicius Dias

Fixing incorrect error message when passing null to join/implode's array parameter (#12683)

Closes GH-12682


# 9a973a37 04-Nov-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Optimize strcspn (#12594)


# d35faecb 01-Nov-2023 Ilija Tovilo

Split strtr zpp (#12583)


# d0b29d82 13-Oct-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Optimize strspn()

The current implementation uses a nested loop (for + goto), which has
complexity O(|s1| * |s2|). If we instead use a lookup table, the
complexity drops to O(|s1| +

Optimize strspn()

The current implementation uses a nested loop (for + goto), which has
complexity O(|s1| * |s2|). If we instead use a lookup table, the
complexity drops to O(|s1| + |s2|).
This is conceptually the same strategy that common C library
implementations such as glibc and musl use.
The variation with a bitvector instead of a table also gives a speed-up,
but the table variation was about 1.34x faster.

On microbenchmarks this easily gave a 5x speedup.

This can bring a 1.4-1.5% performance improvement in the Symfony
benchmark.

Closes GH-12431.

show more ...


# b31a5b27 01-Oct-2023 Ilija Tovilo

Fix str_decrement() on "1"

Closes GH-12339


# f25474f7 11-Jun-2023 HypeMC

Add before_needle argument to strrchr()

Closes GH-11430


# d8696f92 17-Jul-2023 George Peter Banyard

[RFC] Path to Saner Increment/Decrement operators (#10358)

* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_

[RFC] Path to Saner Increment/Decrement operators (#10358)

* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_increment() function

* Add str_decrement() function

RFC: https://wiki.php.net/rfc/saner-inc-dec-operators

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>

show more ...


# 3821938e 07-Mar-2023 Michael Voříšek

Imply UTF8 validity in implode function (#10780)

Sets the UTF-8 valid flag if all parts are valid, or numeric (which are valid UTF-8 by definition).

* remove unuseful comments

Imply UTF8 validity in implode function (#10780)

Sets the UTF-8 valid flag if all parts are valid, or numeric (which are valid UTF-8 by definition).

* remove unuseful comments

* Imply UTF8 validity in implode function

* revert zend_string_dup change

show more ...


# c2d4bafc 03-Feb-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Copy UTF-8 flag for str_repeat


# 2b55dee4 23-Jan-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Make stripslashes() only dependent on SSE2 configuration. (#10408)

Alex Dowad noticed[1] that the SIMD stripslashes implementation actually
only depended on SSE2, and not on SSE4.2 instr

Make stripslashes() only dependent on SSE2 configuration. (#10408)

Alex Dowad noticed[1] that the SIMD stripslashes implementation actually
only depended on SSE2, and not on SSE4.2 instructions. Remove the
checking for SSE4.2 and only check for SSE2. This also greatly
simplifies the supporting code.

[1] https://github.com/php/php-src/pull/10313#issuecomment-1382825073

show more ...


# 256a34ed 28-Nov-2022 David Carlier

strtok warns in case the string to split was not set.

Close GH-10016.


# e951202a 14-Jan-2023 Niels <7771979+nielsdos@users.noreply.github.com>

Remove useless check, search_str is always true here (#10322)


# a4fd2609 13-Oct-2022 Máté Kocsis

Declare ext/standard constants in stubs - part 9 (#9717)


# b1ce1d1f 24-Aug-2023 Kamil Tekiela

Fix param name in implode() error message


# 93e0f6b4 25-Mar-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix undefined behaviour in string uppercasing and lowercasing

At least on 32-bit, the address computations overflow in running the
test on CI with UBSAN enabled. Fix it by reordering the

Fix undefined behaviour in string uppercasing and lowercasing

At least on 32-bit, the address computations overflow in running the
test on CI with UBSAN enabled. Fix it by reordering the arithmetic.
Since a part of the expression is already used in the code above the
computation, this should not negatively affect performance.

Closes GH-10936.

show more ...


# adc5edd4 26-Feb-2023 George Peter Banyard

Fixed ValueError message in count_chars()

The value of the mode argument must be between 0 and 4 inclusive, not 1 and 4.


# 21339701 26-Feb-2023 George Peter Banyard

Fixed ValueError message in substr_compare()

It used some random argument name instead of


# 4bbbe6d6 14-Jan-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix substr_replace with slots in repl_ht being UNDEF

The check that was supposed to check whether the array slot was UNDEF
was wrong and never triggered. This resulted in a replacement w

Fix substr_replace with slots in repl_ht being UNDEF

The check that was supposed to check whether the array slot was UNDEF
was wrong and never triggered. This resulted in a replacement with the
empty string or the wrong string instead of the correct one. The correct
check pattern can be observed higher up in the function's code.

Closes GH-10323

Signed-off-by: George Peter Banyard <girgias@php.net>

show more ...


# 4c9375e5 30-Dec-2022 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-10187: Segfault in stripslashes() with arm64

Closes GH-10188

Co-authored-by: todeveni <toni.viemero@iki.fi>
Signed-off-by: George Peter Banyard <girgias@php.net>


# 3227d04f 08-Sep-2022 Máté Kocsis

Declare ext/standard constants in stubs - part 7 (#9505)


# 3a843f95 24-Jul-2022 dixyes

Windows arm64 zend and standard extension support

* Port zend_cpuid for windows arm64
* Fix zend_atomic windows arm64 build
* Fix windows arm64 multiply
* Enable arm64 neon for w

Windows arm64 zend and standard extension support

* Port zend_cpuid for windows arm64
* Fix zend_atomic windows arm64 build
* Fix windows arm64 multiply
* Enable arm64 neon for windows in standard extension
* Enable arm64 neon for windows in zend_hash.c
* Workaround for msvc arm64 optimization bug

Closes GH-9115.

show more ...


# 6ff662b2 28-Jul-2022 Nikita Popov

Fix unused-but-set-variable warning in hebrev()


12345678910>>...47