History log of /php-src/ext/standard/array.c (Results 1 – 25 of 1129)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 2bdce613 31-Oct-2024 Ilija Tovilo

Fix array going away during sorting

Fixes GH-16648
Closes GH-16654


# 545bef8a 02-Oct-2024 Arnaud Le Blanc

Fix array_merge_recursive(): convert_to_array() may need separation (#16061)


# 27b31314 22-Sep-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-15982: Assertion failure with array_find when references are involved

Closes GH-15983.


# 24a29492 19-Jul-2023 Ilija Tovilo

Fix uouv in array_column

column_long and index_long might not be set, but are still used as arguments.
They are not actually used if column_str is set, but it's better to initialize

Fix uouv in array_column

column_long and index_long might not be set, but are still used as arguments.
They are not actually used if column_str is set, but it's better to initialize
them anyway, if only to make MemorySanitizer happy.

show more ...


# 5853cdb7 20-Aug-2024 Gina Peter Bnayard

Use "must not" instead of "cannot" wording


# e7c4d54d 18-Aug-2024 Gina Peter Bnayard

Use new helper function for "cannot be empty" ValueErrors


# 15bea9ed 03-Jul-2024 David Carlier

Fix GH-14775: range overflow on negative step.

overflow occurs since we only deal with positive steps.

close GH-14778


# 845af777 11-Jun-2024 Peter Kokot

Remove redundant win32/unistd.h includes (#14533)

At this point win32/unistd.h only declares usleep which isn't used at
these places.


# 25a51461 01-Jun-2024 Gina Peter Banyard

Clean-up unused headers (#14365)

* ext/mbstring.c: clean-up headers and include intrinsics


# e4a8d5b1 31-May-2024 Joshua Rüsweg

RFC: array_find (#14108)

see https://wiki.php.net/rfc/array_find


# c461b600 24-May-2024 Levi Morrison

refactor: change `zend_is_true` to return `bool` (#14301)

Previously this returned `int`. Many functions actually take advantage
of the fact this returns exactly 0 or 1. For instance,

refactor: change `zend_is_true` to return `bool` (#14301)

Previously this returned `int`. Many functions actually take advantage
of the fact this returns exactly 0 or 1. For instance,
`main/streams/xp_socket.c` does:

sockopts |= STREAM_SOCKOP_IPV6_V6ONLY_ENABLED * zend_is_true(tmpzval);

And `Zend/zend_compile.c` does:

child = &ast->child[2 - zend_is_true(zend_ast_get_zval(ast->child[0]))];

I changed a few places trivially from `int` to `bool`, but there are
still many places such as the object handlers which return `int` that
should eventually be `bool`.

show more ...


# 04c417a3 04-May-2024 Peter Kokot

Remove unused always-enabled extension headers (#14042)

These were once used in these files but at this point aren't and are
only causing confusion whether file depends on additional ext

Remove unused always-enabled extension headers (#14042)

These were once used in these files but at this point aren't and are
only causing confusion whether file depends on additional extension.

- locale.h is added in main/SAPI.c for _ENABLE_PER_THREAD_LOCALE

show more ...


# dce6ed31 26-Feb-2024 Tim Düsterhus

random: Adjust `status` to `state` (#13521)

* random: Rename `status` local to `state`

* random: Rename `php_random_algo_with_state`'s `status` member to `state`


# 79133df1 25-Feb-2024 Tim Düsterhus

random: Pass algorithm and state together as `php_random_algo_with_state` (#13350)

* random: Remove `php_random_status`

Since 162e1dce9870168cb8c65c013f2b5a510b6536b1, the `php_rand

random: Pass algorithm and state together as `php_random_algo_with_state` (#13350)

* random: Remove `php_random_status`

Since 162e1dce9870168cb8c65c013f2b5a510b6536b1, the `php_random_status` struct
contains just a single `void*`, resulting in needless indirection when
accessing the engine state and thus decreasing readability because of the
additional non-meaningful `->state` references / the local helper variables.

There is also a small, but measurable performance benefit:

<?php
$e = new Random\Engine\Xoshiro256StarStar(0);
$r = new Random\Randomizer($e);

for ($i = 0; $i < 15; $i++)
var_dump(strlen($r->getBytes(100000000)));

goes from roughly 3.85s down to 3.60s.

The names of the `status` variables have not yet been touched to keep the diff
small. They will be renamed to the more appropriate `state` in a follow-up
cleanup commit.

* Introduce `php_random_algo_with_state`

show more ...


# 631bc816 06-Feb-2024 Ilija Tovilo

Implement stackless internal function calls

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

Closes GH-12461


# 45b99f6b 03-Feb-2024 David Carlier

Forgotten piece of GH-13309/GH-13310 previous PR


# d91224cd 03-Feb-2024 David Carlier

Fix GH-13309 and GH-13310: array hashes comparison, wrong buffer len calculation.

php_array_key_compare_string_case_unstable_i has a typo for the second
operand resulting in a wrong buff

Fix GH-13309 and GH-13310: array hashes comparison, wrong buffer len calculation.

php_array_key_compare_string_case_unstable_i has a typo for the second
operand resulting in a wrong buffer size calculation.

Issue reported by @AlexRudyuk

Close GH-13315

show more ...


# d65c3950 31-Jan-2024 Ilija Tovilo

Fix instable array during in-place modification in uksort

The array isn't just observable if the array has RCn, but also if it is inside a
reference that is RCn. By-ref parameters are al

Fix instable array during in-place modification in uksort

The array isn't just observable if the array has RCn, but also if it is inside a
reference that is RCn. By-ref parameters are always RCn and as such always
observable.

Fixes GH-13279
Closes GH-13285

show more ...


# d6536468 18-Jan-2024 Ilija Tovilo

Fix iterator position resetting

Previously, when an array was converted from packed to hashed, iterators would
not be correctly reset to 0. Similarly, removing the last element from an a

Fix iterator position resetting

Previously, when an array was converted from packed to hashed, iterators would
not be correctly reset to 0. Similarly, removing the last element from an array
would decrease nNumUsed but not actually fix the iterator position, causing the
element to be skipped in the next iteration.

Some code was also removed that skips over IS_UNDEF elements for
nInternalPointer and iterator positions. This is unnecessary, as this already
happens during iteration.

Closes GH-13178
Closes GH-13188

show more ...


# fe064d7f 19-Jan-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-13142: Undefined variable name is shortened when contains \0

Uses the new %S formatter and introduces the necessary changes and
helpers.


# 00ea756c 14-Jan-2024 Tim Düsterhus

random/standard: Adjust #13138 for PHP 8.3


# 97c6da1d 14-Jan-2024 Tim Düsterhus

random/standard: Correctly handle broken engines in php_array_pick_keys (#13138)


# 1d6f344b 09-Jan-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-13094: range(9.9, '0') causes segmentation fault

`start_type + end_type < 2*IS_STRING` is not right, in this test case
the types are start_type==5 (IS_DOUBLE), end_type==7 (IS_ARR

Fix GH-13094: range(9.9, '0') causes segmentation fault

`start_type + end_type < 2*IS_STRING` is not right, in this test case
the types are start_type==5 (IS_DOUBLE), end_type==7 (IS_ARRAY).
The IS_ARRAY type is a sentinel to disambiguate single-byte strings.
The path must be taken when one of the types is not a string nor a
single-byte string. Therefore, use < IS_STRING with an OR condition.

Closes GH-13105.

show more ...


# 2053af66 19-Jul-2023 Ilija Tovilo

Fix uouv in array_column

column_long and index_long might not be set, but are still used as arguments.
They are not actually used if column_str is set, but it's better to initialize

Fix uouv in array_column

column_long and index_long might not be set, but are still used as arguments.
They are not actually used if column_str is set, but it's better to initialize
them anyway, if only to make MemorySanitizer happy.

show more ...


# 798c40a7 19-Jun-2023 George Peter Banyard

[RFC] Define proper semantics for range() function (#10826)

RFC: https://wiki.php.net/rfc/proper-range-semantics


12345678910>>...46