We also need to go through request shutdown. The naming is a bit
confusing, but it's fine to go through fastcgi_request_done even
if not using fastcgi. Whether we loop or not is checked separately.
Don't include a trailing newline in T_COMMENT tokens, instead leave
it for a following T_WHITESPACE token. The newline does not belong
to the comment logically, and this makes for an ugly special case,
as other tokens do not include trailing newlines.
Whitespace-sensitive tooling will want to either forward or backward
emulate this change.
Closes GH-5182.
Make user-exposed sorts stable, by storing the position of elements
in the original array, and using those positions as a fallback
comparison criterion. The base sort is still hybrid q/insert.
The use of true/false comparison functions is deprecated (but still
supported) and should be replaced by -1/0/1 comparison functions,
driven by the <=> operator.
RFC: https://wiki.php.net/rfc/stable_sorting
Closes GH-5236.
This avoids ubsan warnings. Alternatively we could always initialize
iterator_funcs_ptr for aggregates, instead of doing so only for
non-internal ones.
Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal classes: They can implement the internal
get_iterator mechanism, without exposing either the Iterator or
IteratorAggregate APIs. This makes them usable in get_iterator(),
but incompatible with any Iterator based APIs.
A lot of internal classes do this, because exposing the userland
APIs is simply a lot of work. This patch alleviates this issue by
providing a generic InternalIterator class, which acts as an
adapater between get_iterator and Iterator, and can be easily
used by many internal classes. At the same time, we extend the
requirement that Traversable implies Iterator or IteratorAggregate
to internal classes as well.
Closes GH-5216.
Context: https://externals.io/message/108789
This essentially moves the functionality of SimpleXMLIterator into
SimpleXMLElement, and makes SimpleXMLIterator a no-op extension.
Ideally SimpleXMLElement would be an IteratorAggregate, whose
getIterator() method returns SimpleXMLIterator. However, because
SimpleXMLIterator extends SimpleXMLElement (and code depends on
this in non-trivial ways), this is not possible.
The only way to not keep SimpleXMLElement as a magic Traversable
(that implements neither Iterator nor IteratorAggregate) is to
move the SimpleXMLIterator functionality into it.
Closes GH-5234.
- Remove dead code from php_crypt_r.c
This code has been commented out since the file was added in 2008. It's safe to say
that no-one is ever going to use it.
- Fix typo in comment in php_crypt_r.c
- Remove redundant Windows-only implementation of php_md5_crypt_r
There is a portable implementation in the same file, which is selected if not
building for Windows. But why should Windows have its own special implementation
of this function at all? There doesn't seem to be any good reason.
Better to use the portable implementation on all platforms.
- Don't define useless __CONST macro in php_crypt_r.h
This preprocessor macro is not used anywhere.
- Add comment on functions for encoding data as Base64
- Remove dead code from crypt_blowfish.h
- Remove unneeded junk comments from crypt_freesec.c
- Remove dead code from crypt_blowfish.c
This function has been commented out since 2011.