1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00
Commit Graph

118899 Commits

Author SHA1 Message Date
Nikita Popov eeb7a7cd7a Add UPGRADING note for pty support
[ci skip]
2020-05-31 17:14:41 +02:00
Nikita Popov 393cd89ffb Add UPGRADING note for xmlrpc unbundling
And drop other UPGRADING references to xmlrpc. I don't think it
makes sense to have those for extensions that are no longer
shipped...

[ci skip]
2020-05-31 16:57:37 +02:00
Nikita Popov d7f17ea44d Fix some line overruns in UPGRADING
[ci skip]
2020-05-31 16:55:46 +02:00
Nikita Popov 805e3e3af4 Move upgrading note for mixed
This should be in the "new features" section.

[ci skip]
2020-05-31 16:48:14 +02:00
Daniel Ruf cf513c2dc8 Fix small typo in comment 2020-05-31 15:03:09 +02:00
Moni c5d9736130 update node-fetch url 2020-05-31 12:23:28 +02:00
Máté Kocsis 4a10eb4f53 Fix #79653 Unexpected error for ArrayIterator::ksort()
Closes GH-5644
2020-05-30 16:59:49 +02:00
George Peter Banyard 2302b14aab Use ZPP callable check for spl_autoload_register.
This makes it always throw a TypeError, moreover this makes the
error message consistent.

Added a warning mentioning that the second parameter is now ignored
when passed false.

Closes GH-5301
2020-05-30 13:59:06 +02:00
Máté Kocsis dd6e54b746 Fix #79652 Ensure that the mixed type is displayed instead of the union of all types
Closes GH-56430
2020-05-30 08:58:59 +02:00
Christoph M. Becker 4fa3687e56 Unbundle ext/xmlrpc
According to <https://wiki.php.net/rfc/unbundle_xmlprc> we unbundle
ext/xmlrpc.
2020-05-29 16:47:44 +02:00
Máté Kocsis 444aa2636e Add upgrading notes about the deprecated functionality in ext/enchant
[skip ci]
2020-05-29 15:15:27 +02:00
Máté Kocsis cd3e04dff3 Convert enchant resources to opaque objects
Additionally, deprecate ENCHANT_MYSPELL and ENCHANT_ISPELL constants.
Closes GH-5577

Co-authored-by: Remi Collet <remi@php.net>
2020-05-29 14:51:41 +02:00
Christoph M. Becker f06844239f Support libzip 1.6 on Windows 2020-05-29 13:43:51 +02:00
Nikita Popov ec3ee1f173 Fix Windows build 2020-05-29 12:58:31 +02:00
Dmitry Stogov 8e8c5a73ee Fixed tracing JIT register allocator (failure on ext/opcache/tests/jit/assign_002.phpt) 2020-05-29 13:27:47 +03:00
Dmitry Stogov dc7a0fb236 Allow tracing JIT generate code when function exits from VM (e.g. for magic __get/__set) 2020-05-29 13:25:59 +03:00
Nikita Popov 7562679b45 Remove json checks in fuzzer SAPI
JSON is now always enabled
2020-05-29 12:08:45 +02:00
Dmitry Stogov 7aa8c7e6aa Don't add guards that are not going to be checked 2020-05-29 12:17:09 +03:00
Dmitry Stogov de7a0df0a2 Fixed use-after-free in tracing JIT when recording closures and top-level op_arrays. 2020-05-29 00:45:28 +03:00
Tyson Andre 32a1ebbd43 Clean up calls to extension_loaded('json') in tests
These are no longer needed after https://wiki.php.net/rfc/always_enable_json

Closes GH-5637
2020-05-28 15:07:47 -04:00
Dmitry Stogov 784f1b5c49 Fixed tracing JIT type inference for passing undefined CV by value 2020-05-28 18:35:32 +03:00
Dmitry Stogov 0abe742d72 Fixed incorrect trace type inference for top-level code 2020-05-28 17:43:29 +03:00
Dmitry Stogov 1d98bd41e5 Fixed incorrect type inference 2020-05-28 17:10:05 +03:00
Christoph M. Becker 6b769a3dc6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix PVS-Studio integration
2020-05-28 15:35:47 +02:00
Christoph M. Becker 8068fad481 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix PVS-Studio integration
2020-05-28 15:34:09 +02:00
Christoph M. Becker 744f9016c4 Fix PVS-Studio integration
Without this configuration option, PVS-Studio looks for preprocessed
files (*.i), but these do not exists.
2020-05-28 15:23:37 +02:00
David Carlier 6dca024a09 Build fix for newer versions of NetBSD.
its libutil contains newer conflicting apis as estrdup, emalloc.

Closes GH-5635
2020-05-28 14:31:04 +02:00
Nikita Popov 70b2aa7fb8 Ensure Exception::getFile/getLine return type is correct
These return an untyped protected property, so we can't rely on
the type being correct.

Also add return types to the interface -- normally this would be
a no-go, but Throwable is a special interface that can only
be implemented internally, so we control all implementations.
2020-05-28 14:19:47 +02:00
Nicolas Grekas d579e1809a Run Symfony tests in per-component 2020-05-28 14:08:27 +02:00
Nicolas Grekas ef9a790f12 Re-enable Symfony test on PHP 8 2020-05-28 14:08:25 +02:00
Nikita Popov 5716fa7f49 Make Exception::$previous a typed property
Exception::$previous is a private property, so we can add a type:

    private ?Throwable $previous = null;
2020-05-28 14:01:29 +02:00
Nikita Popov aaae77f7f1 Make Exception::$trace typed array property
This is a private property, so we are allowed to add a type.
The new declaration of the property is:

    private array $trace = [];

This ensures that Exception::getTrace() does indeed return an array.

Userland code that was modifying the property through refleciton
may have to be adjusted to assign an array (instead of null,
for example).

Closes GH-5636.
2020-05-28 13:55:38 +02:00
Dmitry Stogov c16dbed0c4 Avoid recording of uninitialized types.
VM doesn't set Z_TYPE() for IS_VAR when passes class_entry reference.
2020-05-28 14:39:41 +03:00
Máté Kocsis 58cb0e4732 Add some mixed parameter types and fix UNKNOWN default values in ext/xmlrpc 2020-05-28 12:41:48 +02:00
Nikita Popov 01e86d6d70 Extract code for declaring Exception/Error properties 2020-05-28 12:15:16 +02:00
Nikita Popov 55dd3945fb Convert Exception::getMessage() result to string
We specify that the return type of Exception::getMessage() is a
string. However, we don't currently ensure this, because
Exception::$message is a protected member that can be set to any
type. Fix this by performing an explicit type-cast.

This also requires a temporary refcount increment in the __toString()
object handler, because there is no additional owner of the object,
and it may get released prematurely as part of the __toString() call.
2020-05-28 11:51:35 +02:00
Dmitry Stogov efbe96166d Split "opcache.jit_max_recursion_unroll" into "opcache.jit_max_recursive_calls" and "opcache.jit_max_recursive_returns".
It's possible to disable recording of "recursive return loops" setting opcache.jit_max_recursive_returns to 0.
2020-05-28 12:28:05 +03:00
Nicolas Grekas caca664871 Fix func info for sodium_crypto_aead_xchacha20poly1305_ietf_decrypt 2020-05-28 10:44:26 +02:00
Nikita Popov b53f83c0c3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use automatic port assignment in socket_import/export test
2020-05-28 10:20:12 +02:00
Nikita Popov 490ca05883 Use automatic port assignment in socket_import/export test 2020-05-28 10:18:59 +02:00
Dmitry Stogov 501a2e86e8 Add a side exit on enter to function if it may be called with different number of arguments. 2020-05-28 01:22:32 +03:00
Dmitry Stogov bd329a6019 Keep information about SEND_UNPACK/SEND_ARRAY in call_info 2020-05-27 22:15:14 +03:00
Dmitry Stogov d2d5738b32 Fixed tracing JIT support for ZEND_RETURN_BY_REF in CALL VM 2020-05-27 18:04:16 +03:00
Dmitry Stogov 0bf2bfcf8d Fixed tracing JIT for CALL VM 2020-05-27 17:05:06 +03:00
Dmitry Stogov 645ff9c8f6 Revert "Fixed tracing JIT for CALL VM"
This reverts commit 7f3a296f84.
2020-05-27 17:04:31 +03:00
Remi Collet 17649648ed always build json statically 2020-05-27 15:36:07 +02:00
Tyson Andre cc27781f40 [RFC] Always enable JSON support in php 8.0
Currently, it's possible to disable the json extension with
`./configure --disable-json` (for historical reasons that no longer apply).
However, JSON is widely used in many use cases - web sites, logging output,
and as a data format that can be used to share data with many applications
and programming languages,
so I'd personally find it useful if it was always enabled.

Examples of where this would be useful:

- For internal classes to be able to implement `JsonSerializable`
  which currently requires a hard dependency on the JSON extension.
- For PHP users to publish single-file scripts that use json_encode and
  json_decode and don't require polyfills or less readable var_export output.
  (polyfills are less efficient and may have issues with recursive data
  structures)
- So that php-src's own modules, tools and test cases can start using JSON
  if it's a good choice for encoding a value. (same for PECLs)

https://wiki.php.net/rfc/jsond mentions that in PHP 5,

> The current Json Parser in the json extension does not have a free license
> which is a problem for many Linux distros.
> This has been referenced at Bug #63520.
> That results in not packaging json extension in the many Linux distributions.

Starting in php 7.0 with the switch to jsond,
It looks like licensing is no longer an issue.

Changes:

- Remove all flags related to JSON such as `configure --disable-json`
- Require that JSON be compiled statically instead of as a shared library

Examples of uses of JSON in various distros
(backwards incompatible changes such as changing packaging are typically
reserved for major versions, and 8.0 is a major version)

- JSON is required by `php-cli` or `php` in ubuntu:
  https://packages.ubuntu.com/focal/php/
- The php-json package has to be installed separately
  from the PHP binary in Fedora repos.

Closes GH-5495
2020-05-27 09:08:43 -04:00
Dmitry Stogov 7f3a296f84 Fixed tracing JIT for CALL VM 2020-05-27 15:59:29 +03:00
Christoph M. Becker c5cf0af8a9 Mark several phpdbg tests as xfail
Apparently, breakpoints and watchpoints are practically disabled if
run with OPcache JIT under Windows, so we mark the affected tests as
xfail in that case for the time being.
2020-05-27 11:39:15 +02:00
Nikita Popov 0221b8b2ab Add support for * width and precision in printf()
If * is used for width/precision in printf, then the width/precision
is provided by a printf argument instead of being part of the format
string. Semantics generally match those of printf in C.

This can be used to easily reproduce PHP's float printing behavior:

    // Locale-sensitive using precision ini setting.
    // Used prior to PHP 8.0.
    sprintf("%.*G", (int) ini_get('precision'), $float);

    // Locale-insensitive using precision ini setting.
    // Used since to PHP 8.0.
    sprintf("%.*H", (int) ini_get('precision'), $float);

    // Locale-insensitive using serialize_precision ini setting.
    // Used in serialize(), json_encode() etc.
    sprintf("%.*H", (int) ini_get('serialize_precision'), $float);

Closes GH-5432.
2020-05-27 10:42:25 +02:00