1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 21:52:36 +02:00
Commit Graph

55211 Commits

Author SHA1 Message Date
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
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
Dmitry Stogov
2423288f0f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed possible usage of uninitialized value
2020-05-27 11:27:34 +03:00
Dmitry Stogov
886a34b1cc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed possible usage of uninitialized value
2020-05-27 11:26:25 +03:00
Dmitry Stogov
1f521a0b23 Fixed possible usage of uninitialized value 2020-05-27 11:25:18 +03:00
Nikita Popov
b6000b7e0e Add support for %h and %H in printf()
These are locale-independent variants of %g and %G.

Closes GH-5436.
2020-05-27 10:19:23 +02:00
Nikita Popov
a01b6e5787 Return empty array instead of null from enchant APIs
Closes GH-5566.
2020-05-27 10:12:21 +02:00
Dmitry Stogov
f91283fcd4 Fixed JIT for ext/opcache/tests/bool_not_cv.phpt with opcache.jit=1202 2020-05-27 10:57:33 +03:00
Alex Dowad
0bff4e56e2 Tweak style and grammar in proc_open.c 2020-05-27 09:05:31 +02:00
Alex Dowad
dff7994ff4 Avoid compiler warnings in proc_open.c
We are getting a lot of compiler warnings when building on Appveyor CI (Windows).
Fix some of them.

Closes GH-5629
2020-05-27 09:05:14 +02:00
Dmitry Stogov
6e5247275a Fixed JIT for ext/opcache/tests/jit/cmp_004.phpt with opcache.jit=1201 2020-05-27 09:59:12 +03:00
Dmitry Stogov
d2f811438e Set proper jit_extension for inherited methods 2020-05-27 09:58:03 +03:00
Máté Kocsis
0de3ca4f98 Let's try to fix the JIT compiler warning 2020-05-26 20:56:29 +02:00
Máté Kocsis
fbe30592d6 Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.

Closes GH-5625
2020-05-26 19:06:19 +02:00
Christoph M. Becker
38c85efe83 Fix picky builds
Due to `-Werror=maybe-uninitialized` a bogus warning may be thrown, so
we initialize the variable to work-around that.
2020-05-26 18:37:29 +02:00
Dmitry Stogov
15aa891c5e Fixed JIT for integer overflow checks 2020-05-26 17:59:15 +03:00
Dmitry Stogov
59e69eb1c9 Fixed JIT for (LONG_MIN % -1) 2020-05-26 14:49:29 +03:00
Dmitry Stogov
cf3b133a86 Fixed JIT for SEND_VAR $undefined_cv 2020-05-26 10:13:57 +03:00
Nikita Popov
ca358001b9 Revert "Fixed JIT for SEND_VAR $undefined_cv"
This reverts commit d60988257b.

This change causes segfaults in many tests.
2020-05-25 23:51:11 +02:00
Dmitry Stogov
0386cbb95c Fixed tracing JIT for RETRUN $undefined_cv 2020-05-25 22:19:13 +03:00
David Carlier
e8ba8908a9 proc_open FreeBSD build fix
On this platform the needed header is different.

Closes GH-5623
2020-05-25 18:38:38 +02:00
Máté Kocsis
b3718430de Annotate internal functions with the mixed type
Closes GH-5618
2020-05-25 17:30:57 +02:00
Máté Kocsis
cbf86efc21 Fix ZPP of v*printf() 2020-05-25 17:29:46 +02:00
Máté Kocsis
43095a55e2 Promote warning related to operator overloading in ext/gmp to an exception 2020-05-25 17:26:33 +02:00
Dmitry Stogov
d60988257b Fixed JIT for SEND_VAR $undefined_cv 2020-05-25 18:24:50 +03:00
Dmitry Stogov
4aa8678306 ZEND_ACC_IMMUTABLE may be reset for closures 2020-05-25 17:45:13 +03:00
Dmitry Stogov
bfc56ed511 Keep trace number in EG(jit_trace_num) instead of EG(reserved)[zend_func_info_rid] 2020-05-25 17:05:26 +03:00
Dmitry Stogov
3376f19742 Check for ZEND_HANDLE_EXCEPTION opcode before accessing opline trace info. 2020-05-25 16:45:45 +03:00
Dmitry Stogov
201491e61b Replace warning code by side exit to VM 2020-05-25 15:14:27 +03:00
Dmitry Stogov
b35a9a4ce6 Reorder conditions to save one instruction in recursive return loop 2020-05-25 12:55:03 +03:00
Christoph M. Becker
ce668c0ec6 PGSQL and POD_SQL: don't include pg_config.h
Even if that header file is available, we better consider it private,
and don't include it.  The information about whether SSL support is
enabled is now missing (`USE_(OPEN)SSL`), and it seems there is no
alternative way to get it (`PQinitSSL()` is always defined), so we
remove it from the PHP info.  Furthermore, the `PG_VERSION` and
`PG_VERSION_STR` macros are no longer available, but as of libpq 9.1
there is `PQlibVersion()` which allows us to construct `PG_VERSION` in
a most likely backwards compatible manner.  The additional information
available through `PG_VERSION_STR` is lost, though, so we define
`PGSQL_LIBPQ_VERSION_STR` basically as alias of `PGSQL_LIBPQ_VERSION`,
and deprecate it right away.

Since we are now requiring at least libpq 9.1, we can remove some
further compatibility code and additional checks.

Regarding the raised requirements: official support for PostGreSQL 9.0
ended on 2015-10-08, and even CentOS 7 already has PostGreSQL 9.2, so
this is not supposed to be too much of an issue.
2020-05-25 10:48:35 +02:00
Tyson Andre
f3efb9e3fb Fail in ./configure when no opcache shm backends exist
This can be seen when the `./configure` step fails to detect `HAVE_SHM_*`,
e.g. due to missing a necessary dependency to compile the test scripts.
(Run `./configure`, run `yum install libtool-ltdl-devel` for missing dependencies,
then run `make`, and php can end up built with 0 shared memory opcache caches)

Give a clearer error message than `unknown`
Searching for `opcache "Fatal Error Unable to allocate shared memory segment of"
"unknown: No such file or directory"` reveals issues such as
https://github.com/termux/termux-packages/issues/2234

Closes GH-5615
2020-05-24 17:49:52 -04:00
George Peter Banyard
c803499e23 Remove depreacted curly brace offset syntax
Closes GH-5221
2020-05-22 16:52:17 +02:00
Máté Kocsis
aec4c0fd03 Add support for the mixed type
RFC: https://wiki.php.net/rfc/mixed_type_v2
Closes GH-5313

Co-authored-by: Dan Ackroyd <danack@basereality.com>
2020-05-22 16:08:12 +02:00
Christoph M. Becker
4bc1d8333a Raise ext/pgsql requirements to PostGreSQL 7.4
We can safely assume that users have at the very least libpq 7.4, for
which official support ended on 2010-10-01; even CentOS 6 has 8.4 now.
It is also noteworthy that PDO_PGSQL already requires libpq 7.4 or
later.
2020-05-22 15:56:24 +02:00
Christoph M. Becker
7f51f43509 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79615: Wrong GIF header written in GD GIFEncode
2020-05-22 09:22:38 +02:00
Christoph M. Becker
da801ba5e3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79615: Wrong GIF header written in GD GIFEncode
2020-05-22 09:19:05 +02:00
Christoph M. Becker
d4bd6fb491 Fix #79615: Wrong GIF header written in GD GIFEncode
The color resolution is expected in bits 4-6 of the packed fields byte
of the logical screen descriptor (byte 10 of the GIF data stream),
according to the specification[1], section 18.

[1] <https://www.w3.org/Graphics/GIF/spec-gif89a.txt>
2020-05-22 09:15:41 +02:00
Dmitry Stogov
bb1a68b40c Use EX(run_time_cache) instead of RUN_TIME_CACHE(&EX(func)->op_array) 2020-05-21 18:35:32 +03:00
Dmitry Stogov
a9b2ff3dda simplification 2020-05-21 18:01:44 +03:00