summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-103-6/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Make finfo_open() $magic_database nullable
| * | Make finfo_open() $magic_database nullableNikita Popov2021-02-103-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Empty string was interpreted as a special value here, which indicates that the default magic database should be used. It makes more sense to use null for this purpose. The documentation also explicitly mentions that null can be used.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-101-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Don't pass null action to __doRequest
| * | Don't pass null action to __doRequestNikita Popov2021-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parameter is not nullable, so it will be interpreted as an empty string anyway. The entire code here is pretty confusing though, and probably deserves a second loop. The HTTP code only send SOAPAction/action if soapaction is non-NULL -- but it always is, because it is accepted through a non-nullable string parameter. Regarding the SOAPAction header, it appears that always sending it is actually a requirement of the standard: > An HTTP client MUST use this header field when issuing a SOAP > HTTP Request. Although it does make a distinction between absence of value and an empty string: > The header field value of empty string ("") means that the intent > of the SOAP message is provided by the HTTP Request-URI. No value > means that there is no indication of the intent of the message. The empty string interpretation appears to be the desired one. However, for the action MIME tag the SOAP 1.2 Part 2 specification says that > The media type specifies an optional action parameter, which can > be used to optimize dispatch or routing, among other things. but also > The SOAP Action feature defines a single property, which is > described in Table 14. The value of this property MUST be an > absolute URI[RFC 3986] and MUST NOT be empty. which would indicate that we should not be sending an empty action here. As I'm not familiar with SOAP and this is long-standing behavior, I'm just leaving this alone for now...
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-102-7/+4
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-8.0: Clarify that location is required in do_request Regenerate arginfo file
| * | Clarify that location is required in do_requestNikita Popov2021-02-101-5/+2
| | | | | | | | | | | | | | | | | | As far as I can tell, the location is always non-null here, and the code wouldn't be able to meaningfully work without a location.
| * | Regenerate arginfo fileNikita Popov2021-02-101-2/+2
| | | | | | | | | | | | Somehow missed this in the previous commit.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-102-2/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Accept null $location in SoapClient::__setLocation()
| * | Accept null $location in SoapClient::__setLocation()Nikita Popov2021-02-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently an empty string is used to unset the location. Once again, it makes more sense to use a null value for this purpose (though the special behavior of empty strings is retained). The code comment above the function also explicitly indicates that null should be accepted, and the function does return null rather than an empty string for the old location value (if it is missing).
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-103-7/+7
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Make SoapVar arguments nullable
| * | Make SoapVar arguments nullableNikita Popov2021-02-103-7/+7
| | | | | | | | | | | | | | | | | | | | | $typeName, $typeNamespace, $nodeName and $nodeNamespace all special-case the empty string and don't set the property entirely in that case. It makes more sense to use null to indicate absence here (though of course the empty string behavior is retained).
| * | Add missing classes to stubsMáté Kocsis2021-02-0914-18/+115
| | |
* | | Optimize ZEND_COUNT opcodes on arrays in the jitTyson Andre2021-02-094-1/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid the overhead of a call and checking types when the argument is definitely an array. Avoid the overhead of gc when `__destruct` won't get called. This seemed cheap enough to check for in the jit. Because of https://wiki.php.net/rfc/restrict_globals_usage we can be sure in the ZEND_COUNT handler that the array count does not have to be recomputed in php 8.1. The below example took 0.854 seconds before the optimization, and 0.564 seconds after the optimization, giving the same result ```php <?php /** @jit */ function bench_count(int $n): int { $total = 0; $arr = []; for ($i = 0; $i < $n; $i++) { $arr[] = $i; $total += count($arr); } return $total; } function main() { $n = 1000; $iterations = 50000; $start = microtime(true); $result = 0; for ($i = 0; $i < $iterations; $i++) { $result += bench_count($n); } $elapsed = microtime(true) - $start; printf("Total for n=%d, iterations=%d = %d, elapsed=%.3f\n", $n, $iterations, $result, $elapsed); } main(); ``` Before ```asm mov $0x7feb8cf8a858, %r15 mov $ZEND_COUNT_SPEC_CV_UNUSED_HANDLER, %rax call *%rax ``` After ```asm mov 0x70(%r14), %rdi - Copy the count from the `zend_array*` pointer mov %rdi, (%rax) - Store the count in the destination's value mov $0x4, 0x8(%rax) - Store IS_LONG(4) in the destination's type ``` And add tracing jit support Closes GH-5584
* | | Added Inheritance Cache.Dmitry Stogov2021-02-0919-911/+702
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a new transparent technology that eliminates overhead of PHP class inheritance. PHP classes are compiled and cached (by opcahce) separately, however their "linking" was done at run-time - on each request. The process of "linking" may involve a number of compatibility checks and borrowing methods/properties/constants form parent and traits. This takes significant time, but the result is the same on each request. Inheritance Cache performs "linking" for unique set of all the depending classes (parent, interfaces, traits, property types, method types involved into compatibility checks) once and stores result in opcache shared memory. As a part of the this patch, I removed limitations for immutable classes (unresolved constants, typed properties and covariant type checks). So now all classes stored in opcache are "immutable". They may be lazily loaded into process memory, if necessary, but this usually occurs just once (on first linking). The patch shows 8% improvement on Symphony "Hello World" app.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-093-19/+25
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-8.0: Properly check imagegd() signature Make imagegd $file parameter nullable
| * | Properly check imagegd() signatureNikita Popov2021-02-091-2/+12
| | | | | | | | | | | | | | | Unlike imagegd2(), this function only accepts two parameters, so we should be checking for that.
| * | Make imagegd $file parameter nullableNikita Popov2021-02-093-18/+14
| | | | | | | | | | | | | | | | | | It is explicitly documented to be nullable, and this matches other functions like imagepng. It is also documented to accept a stream, which it currently does not...
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-097-15/+15
|\ \ \ | |/ / | | | | | | | | | | | | | | | * PHP-8.0: Use E_ERROR to report arginfo/zpp mismatch Make NumberFormatter ctor $pattern nullable Make IntlDateFormatter ctor $pattern nullable
| * | Make NumberFormatter ctor $pattern nullableNikita Popov2021-02-095-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Whether the pattern is needed depends on the used style. If no pattern is needed, null is a more sensible value than an empty string. fixup
| * | Make IntlDateFormatter ctor $pattern nullableNikita Popov2021-02-094-8/+8
| | | | | | | | | | | | | | | The implementation already made this argument nullable, but it was not reflected in the stub.
* | | Generate ext/intl class entries from stubsMáté Kocsis2021-02-0944-157/+276
| | | | | | | | | | | | Closes GH-6670
* | | Implicitly enable function entry generation when class entry generation is ↵Máté Kocsis2021-02-0962-157/+62
| | | | | | | | | | | | | | | | | | enabled Closes GH-6675
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-0913-15/+15
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Make Phar $fileNotFoundScript nullable
| * | Make Phar $fileNotFoundScript nullableNikita Popov2021-02-0913-15/+15
| | | | | | | | | | | | | | | | | | | | | While "" is already treated the same way as absence, null is the logically correct default here. Making this one argument non-nullable is particularly pecular when considering that the preceding $alias and $index arguments are both nullable.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-094-4/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Make createDocument() $namespace nullable
| * | Make createDocument() $namespace nullableNikita Popov2021-02-094-4/+5
| | | | | | | | | | | | | | | | | | According to the DOM specification, this argument should be nullable. It's also supposed to be a required argument, but not changing that at this point.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-095-12/+20
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Make getElementsByTagNameNS $namespace nullable
| * | Make getElementsByTagNameNS $namespace nullableNikita Popov2021-02-095-12/+20
| | | | | | | | | | | | | | | According to the DOM specification, this argument is supposed to be nullable.
* | | Remove usage of float keys in arraysGeorge Peter Banyard2021-02-0981-2483/+1845
| | | | | | | | | | | | | | | | | | Also make test output not produce trailling whitespaces Closes GH-6662
* | | Generate class entries from stubs for another batch of extensionsMáté Kocsis2021-02-0835-86/+314
| | | | | | | | | | | | Closes GH-6669
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-081-3/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix locale dependent parsing of PostgreSQL version number
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-081-3/+6
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix locale dependent parsing of PostgreSQL version number
| | * Fix locale dependent parsing of PostgreSQL version numberChristoph M. Becker2021-02-081-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Version numbers are not supposed to be localized, so we must not apply locale dependent parsing with `atof()`. Using `php_version_compare()` might even be better. Closes GH-6668.
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-081-0/+76
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #80706: mail(): Headers after Bcc headers may be ignored
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-081-0/+76
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #80706: mail(): Headers after Bcc headers may be ignored
| | * Fix #80706: mail(): Headers after Bcc headers may be ignoredChristoph M. Becker2021-02-081-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | We need to handle the case where a CRLF after a Bcc header is not the beginning of a folding marker, because in that case the Bcc header was not the last "thing". Closes GH-6666.
| * | Properly render 2+ namespaces functions in build/gen_stub.phpTyson Andre2021-02-063-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | Affects ZEND_NS_FE Add test cases of the global function Backported to php 8.0 from GH-6664
* | | Skip two gettext tests under --repeatNikita Popov2021-02-082-0/+5
| | | | | | | | | | | | | | | gettext leaks global state across requests, so don't repeat these tests. See also GH-6641.
* | | Properly render 2+ namespaces functions in build/gen_stub.phpTyson Andre2021-02-063-3/+46
| | | | | | | | | | | | | | | | | | | | | | | | Affects both INIT_NS_CLASS_ENTRY and ZEND_NS_FE Add test cases of the global function and namespaced values Closes GH-6664
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-051-3/+3
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-8.0: Fix test expectation for PHP 8.0 Use ST_Y() instead of the deprecated/removed Y() in test
| * | Fix test expectation for PHP 8.0Christoph M. Becker2021-02-051-1/+1
| | | | | | | | | | | | | | | Since float to string conversion is no longer locale dependent, we have to expect a dot as decimal separator.
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-051-2/+2
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Use ST_Y() instead of the deprecated/removed Y() in test
| | * Use ST_Y() instead of the deprecated/removed Y() in testChristoph M. Becker2021-02-051-2/+2
| | |
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-052-1/+43
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #74779: x() and y() truncating floats to integers
| * | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-052-1/+43
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix #74779: x() and y() truncating floats to integers
| | * Fix #74779: x() and y() truncating floats to integersChristoph M. Becker2021-02-052-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | We must not use the locale dependent `atof()`, but instead use the (hopefully) locale independent `zend_strtod()`, when converting string representations of floating point numbers which are sent by the server. Closes GH-6665.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-041-2/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Try SIGTERM before SIGKILL in opcache restart
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-041-2/+5
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Try SIGTERM before SIGKILL in opcache restart
| | * Try SIGTERM before SIGKILL in opcache restartNikita Popov2021-02-041-2/+5
| | | | | | | | | | | | | | | | | | | | | SIGTERM is subject to HANDLE_BLOCK_INTERRUPTIONS(), which will allow code to exit critical sections before it gets terminated. Closes GH-6493.
* | | Merge branch 'PHP-8.0'Christoph M. Becker2021-02-031-17/+41
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix #53467: Phar cannot compress large archives