Nikita Popov [Sun, 1 Dec 2013 12:37:56 +0000 (13:37 +0100)]
Fix bug #65764
I'm not exactly sure whether this is the right way to fix it. The
question is whether Generator::throw() on a newborn generator (i.e.
a generator that is not yet at yield expression) should first advance to
the first yield and throw the exception there or whether it should
instead throw the exception in the caller's context.
The old behavior was to throw it at the start of the function (i.e.
the very first opcode), which causes issues like the one in #65764.
Effectively it's impossible to properly handle the exceptions in this
case.
For now I choose the variant where the generator advances to the
first yield before throwing, as that's consistent with how all other
methods on the Generator object currently behave. This does not
necessarily match the behavior in other languages, e.g. Python would throw
the exception in the caller's context. But then our send() method already
has this kind of deviation, so it stays internally consistent at least.
Nikita Popov [Sat, 30 Nov 2013 12:35:33 +0000 (13:35 +0100)]
Cleanup generator closing code a bit
All code dealing with unfinished execution cleanup is now in a separate
function (previously most of it was run even when execution was properly
finished.
Furthermore some code dealing with unclean shutdowns has been removed,
which is no longer necessary, because we no longer try to clean up in
this case.
nikita2206 [Tue, 29 Oct 2013 15:40:17 +0000 (19:40 +0400)]
Fixed bug #65768: DateTimeImmutable::diff does not work
This commit also prevents user classes from directly implementing
DateTimeInterface, because ext/date relies on classes implementing
it to support certain internal structures.
Derick Rethans [Sun, 31 Mar 2013 17:11:35 +0000 (18:11 +0100)]
Fixed "Forward Transition" construction of DateTime objects.
This fixes the issue in
https://wiki.php.net/rfc/datetime_and_daylight_saving_time#forward_transitions
There is a period during transition to DST where a time (such as 02:30) does
not exist. PHP already calculated the correct timestamp for this, but failed to
"rounded forward" to the existing correct hour value.
Andrea Faulds [Mon, 18 Nov 2013 21:19:07 +0000 (21:19 +0000)]
Merge branch 'CLIGetAllHeadersBackport' into PHP-5.5
* CLIGetAllHeadersBackport:
Removed UPGRADING note
Rewrote test using tcp instead of http:// stream
Implemented FR #65917 (getallheaders() is not supported by the built-in...)
This is CLI web server change. Added some common MIME types to the
existing lookup list, pending a more thorough lookup solution, if
anyone wants to do that. Ref http://news.php.net/php.internals/69990
A router can be used to add to, or override, the MIME type lookups,
see http://php.net/manual/en/features.commandline.webserver.php
Remi Collet [Wed, 13 Nov 2013 12:19:10 +0000 (13:19 +0100)]
Fix failed test with recent glibc
In recent version of strptime glibc upstream has fixed a discrepancy between
documentation and actual behaviour by skipping over the sequence that would match %Z.
See http://repo.or.cz/w/glibc.git/commitdiff/ddc7e412ab252e7360a4357664beb3b5d9c4f42b
So when %Z is used in format
glibc <= 2.18 returns the GMT as unparsed
glibc >= 2.19 returns empty string
Removing %Z from tested format gives the same behavior with all version.
Andrea Faulds [Thu, 17 Oct 2013 22:19:09 +0000 (22:19 +0000)]
Implemented FR #65917 (getallheaders() is not supported by the built-in...)
- Implemented apache_request_headers() and getallheaders() alias in CLI server
- Implemented apache_response_headers() in CLI server using FastCGI code
Adam Harvey [Sun, 10 Nov 2013 21:11:28 +0000 (16:11 -0500)]
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Update NEWS and remove the unnecessary UPGRADING note.
UPGRADING and NEWS
Better test: Check combined leading/trailing
Fixed whitespace part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly")
it use mbsinit there, seems try to initialize the mblen_state, but:
"This function does not change the state identified by ps. Typical ways
to make the state pointed by ps an initial state are:
memset (ps,0,sizeof(*ps)); // ps points to zero-valued object
"
http://www.cplusplus.com/reference/cwchar/mbsinit/?kw=mbsinit