| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One strange feature of SplFixedArray was that it could not be used in nested foreach
loops. If one did so, the inner loop would overwrite the iteration state of the outer
loop.
To illustrate:
$spl = SplFixedArray::fromArray([0, 1]);
foreach ($spl as $a) {
foreach ($spl as $b) {
echo "$a $b";
}
}
Would only print two lines:
0 0
0 1
Use the new InternalIterator feature which was introduced in ff19ec2df3 to convert
SplFixedArray to an Aggregate rather than Iterable. As a bonus, we get to trim down
some ugly code! Yay!
|
| |
|
|
| |
Closes GH-5606
|
| | |
|
| | |
|
| |
|
|
| |
Closes GH-5418
|
| | |
|
| |
|
|
| |
Closes GH-6179
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Make sure we throw the same kind of error regardless of whether
the offset is out-of-bounds in the fast path or in the slow
path.
|
| |
|
|
| |
An offset equal to the string length is not out of bounds.
|
| |\
| |
| |
| |
| | |
* PHP-7.4:
Fix #76943: Inconsistent stream_wrapper_restore() errors
|
| | |\
| | |
| | |
| | |
| | | |
* PHP-7.3:
Fix #76943: Inconsistent stream_wrapper_restore() errors
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If restoring of any not registered built-in wrapper is requested, the
function is supposed to fail with a warning, so we have to check this
condition first.
Furthermore, to be able to detect whether a built-in wrapper has been
changed, it is not sufficient to check whether *any* userland wrapper
has been registered, but rather whether the specific wrapper has been
modified.
Closes GH-6183.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Errors related to invalid format strings (unlike data mismatch
errors) should throw ValueError.
Closes GH-6185.
|
| | | | |
|
| |\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix #79423: copy command is limited to size of file it can copy
|
| | |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fix #79423: copy command is limited to size of file it can copy
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Passing `NULL` as `lpFileSizeHigh` to `GetFileSize()` gives wrong
results for files larger than 0xFFFFFFFF bytes. We fix this by using
`GetFileSizeEx()`, and let the mapping fail, if the file size is too
large for the architecture.
Closes GH-5319.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Cross checking implementations from other languages, empty strings
are always allowed. PHP's output is peculiar due to it's insistence
to encode a trailing \0, but otherwise sensible and does round-trip
as expected.
|
| | | |
| | |
| | |
| | | |
php_stream_bucket_new() is infallible.
|
| | | |
| | |
| | |
| | | |
These may return an empty array, but not false.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Return "0000" instead of false to have a consistent return type.
"0000" is already a possible return value if the string doesn't
contain any letters, such as with soundex(" "). We can treat the
case of soundex("") exactly the same.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
Assert that ht is not null and make php_url_encode_hash_ex() return
void to clarify that this is an infallible function.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
php_unescape_html_entities() never returns null, so this function
can never return false.
php_unescape_html_entities() probably should be failing with OOM
for the "overflow" case, but even if it did, it would not be
signalled through a false return value.
|
| | | |
| | |
| | |
| | | |
And thus avoid the false return value.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
strspn/strcspn are string search functions, and as such should throw
ValueError on out-of-bounds offsets, just like strpos etc do.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The implementation here was pretty confused. In reality the only
error condition it has right now is that for a string input,
from & length cannot be arrays.
The fact that the array lengths are the same was probably supposed
to be checked for the case of array input, as it wouldn't matter
otherwise.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Initiailize -> Initialize
Closes GH-6181.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
Closes GH-6180
|
| | | | |
|
| | | |
| | |
| | |
| | | |
It is used only once with allow_errors enabled
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Support for this was removed in PHP 7.0.
See: https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings
|
| | | |
| | |
| | |
| | |
| | | |
This makes it line up with pg_fetch_all_columns(), as well as
similar functions in other exts, such as mysqli_fetch_all().
|
| | | |
| | |
| | |
| | |
| | |
| | | |
We previously couldn't increase the error level here because it
was coupled to comparison handling. This is no longer the case
in PHP 8.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
We missed the change to make this an Error exception in PHP 8,
but at least elevate it to a warning, to avoid a notice -> exception
jump at a later time.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The same error condition is a ValueError in mysqli, be consistent.
Additionally, do not display the argument name for these errors.
As the signatures are overloaded, the argument name may not match
the meaning at all.
|
| | | |
| | |
| | |
| | | |
This was already checked directly above.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Checking the linker compatibility with extranous `ImageLoad()` calls is
possible, but unnecessary, since the modules are either already loaded
or loaded shortly afterwards, so that we can get the required
information directly from the module handles. And actually, doing
`ImageLoad()` as well as `LoadLibrary()` leaves a tiny room for a race
condition, because both functions will lookup the module in the search
path, so there is no *guarantee* that both are dealing with the same
module. Dropping the `ImageLoad()` calls also has the advantage to no
longer face the issue reported in bug #79557. A very minor additional
advantage is that we no longer have to link against Imagehlp.dll.
Furthermore, there is no need to check for CRT compatibility multiple
times, so we can simplify the signature of `php_win32_crt_compatible`,
and at the same time clean up main.c a bit.
These changes require to change the signature of the exported
`php_win32_image_compatible` and `php_win32_crt_compatible` functions,
which now expect a `HMODULE` and nothing, respectively, instead of the
module name.
|
| |\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix mmap copying
|