]> granicus.if.org Git - php/log
php
4 years agoFix weird zend_bool usage in Intl Calendar::roll() method
George Peter Banyard [Tue, 2 Jun 2020 23:13:04 +0000 (01:13 +0200)]
Fix weird zend_bool usage in Intl Calendar::roll() method

This code really needs to be review as it's convoluted for no good reason.

4 years agoin_array() avoid internal property access as we have the arrlen already
Matthias Dötsch [Thu, 4 Jun 2020 16:58:41 +0000 (18:58 +0200)]
in_array() avoid internal property access as we have the arrlen already

Closes GH-5662

4 years agoAdd upgrading note for Attributes RFC
Benjamin Eberlei [Thu, 4 Jun 2020 16:21:18 +0000 (18:21 +0200)]
Add upgrading note for Attributes RFC

[ci-skip]

4 years agoAdd Attributes
Benjamin Eberlei [Sun, 24 May 2020 18:57:00 +0000 (20:57 +0200)]
Add Attributes

Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Thu, 4 Jun 2020 11:40:16 +0000 (13:40 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #73527: Invalid memory access in php_filter_strip

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 4 Jun 2020 11:38:14 +0000 (13:38 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #73527: Invalid memory access in php_filter_strip

4 years agoFix #73527: Invalid memory access in php_filter_strip
Christoph M. Becker [Thu, 4 Jun 2020 09:49:59 +0000 (11:49 +0200)]
Fix #73527: Invalid memory access in php_filter_strip

4 years agoAdd guard for FETCH_DIM_FUNC_ARG
Dmitry Stogov [Thu, 4 Jun 2020 11:04:21 +0000 (14:04 +0300)]
Add guard for FETCH_DIM_FUNC_ARG

4 years agoPrefer shorter x86 instructions
Dmitry Stogov [Thu, 4 Jun 2020 10:19:42 +0000 (13:19 +0300)]
Prefer shorter x86 instructions

4 years agoImplement #47074: phpinfo() reports "On" as 1 for the some extensions
Christoph M. Becker [Wed, 3 Jun 2020 23:03:14 +0000 (01:03 +0200)]
Implement #47074: phpinfo() reports "On" as 1 for the some extensions

What is modified as boolean, should also be displayed as boolean.

4 years agoImproved tracing JIT for FETCH_OBJ_R/IS
Dmitry Stogov [Thu, 4 Jun 2020 09:23:27 +0000 (12:23 +0300)]
Improved tracing JIT for FETCH_OBJ_R/IS

4 years agoRemove MYSQLND_COMPRESSION_WANTED define
Nikita Popov [Thu, 4 Jun 2020 08:03:39 +0000 (10:03 +0200)]
Remove MYSQLND_COMPRESSION_WANTED define

Instead directly define MYSQLND_COMPRESSION_ENABLED. This also
matches what config.w32 does.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 4 Jun 2020 08:02:12 +0000 (10:02 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  mysqlnd: Remove unnecessary check for HAVE_ZLIB

4 years agomysqlnd: Remove unnecessary check for HAVE_ZLIB
talyz [Wed, 3 Jun 2020 19:21:18 +0000 (21:21 +0200)]
mysqlnd: Remove unnecessary check for HAVE_ZLIB

If MYSQLND_COMPRESSION_WANTED is set, we already guarantee that
zlib is linked, but don't necessarily set HAVE_ZLIB.

Closes GH-5658.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Thu, 4 Jun 2020 07:11:13 +0000 (09:11 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79668: get_defined_functions(true) may miss functions

4 years agoTracing JIT for FETCH_DIM_FUNC_ARG and FETCH_OBJ_FUNC_ARG when they are used in READ...
Dmitry Stogov [Thu, 4 Jun 2020 07:03:15 +0000 (10:03 +0300)]
Tracing JIT for FETCH_DIM_FUNC_ARG and FETCH_OBJ_FUNC_ARG when they are used in READ mode (to pass by value).

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 4 Jun 2020 06:47:25 +0000 (08:47 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79668: get_defined_functions(true) may miss functions

4 years agoFix #79668: get_defined_functions(true) may miss functions
Christoph M. Becker [Wed, 3 Jun 2020 10:05:00 +0000 (12:05 +0200)]
Fix #79668: get_defined_functions(true) may miss functions

Instead of some brittle and unefficient string matching, we can just
check for the function handler.

4 years agoFixed abstract stack consistency for JMPZ_EX/JMPNZ_EX
Dmitry Stogov [Wed, 3 Jun 2020 21:17:13 +0000 (00:17 +0300)]
Fixed abstract stack consistency for JMPZ_EX/JMPNZ_EX

4 years ago"call_info" doesn't matter
Dmitry Stogov [Wed, 3 Jun 2020 19:50:40 +0000 (22:50 +0300)]
"call_info" doesn't matter

4 years agoAvoid useless register reload
Dmitry Stogov [Wed, 3 Jun 2020 15:14:51 +0000 (18:14 +0300)]
Avoid useless register reload

4 years agoFix typo in skipif section
Nikita Popov [Wed, 3 Jun 2020 12:50:35 +0000 (14:50 +0200)]
Fix typo in skipif section

Merge mistake...

4 years agoAvoid useless REFCOUNTED check
Dmitry Stogov [Wed, 3 Jun 2020 09:11:39 +0000 (12:11 +0300)]
Avoid useless REFCOUNTED check

4 years agoFix #79665: ini_get() and opcache_get_configuration() inconsistency
Christoph M. Becker [Tue, 2 Jun 2020 12:58:26 +0000 (14:58 +0200)]
Fix #79665: ini_get() and opcache_get_configuration() inconsistency

Overriding the given INI values in modifier callbacks is not possible,
so instead of enforcing "normalized" internal values, we just reject
the attempted changes.

4 years agoUse cheaper zend_rethrow_exception() instead of zend_throw_exception_internal()
Dmitry Stogov [Wed, 3 Jun 2020 08:51:04 +0000 (11:51 +0300)]
Use cheaper zend_rethrow_exception() instead of zend_throw_exception_internal()

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 3 Jun 2020 08:17:27 +0000 (10:17 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Report len as -1 instead of INT_MAX

4 years agoReport len as -1 instead of INT_MAX
Nikita Popov [Wed, 3 Jun 2020 08:15:54 +0000 (10:15 +0200)]
Report len as -1 instead of INT_MAX

Per docs it should be -1. And would be on 32-bit systems, but
not on 64-bit systems.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 3 Jun 2020 08:02:31 +0000 (10:02 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Skip new watch point test under asan

4 years agoSkip new watch point test under asan
Nikita Popov [Wed, 3 Jun 2020 08:01:57 +0000 (10:01 +0200)]
Skip new watch point test under asan

4 years agoHandle VM interrupts after DO_ICALL through side exits
Dmitry Stogov [Wed, 3 Jun 2020 07:58:17 +0000 (10:58 +0300)]
Handle VM interrupts after DO_ICALL through side exits

4 years ago%d out token IDs in test
Nikita Popov [Wed, 3 Jun 2020 07:57:01 +0000 (09:57 +0200)]
%d out token IDs in test

Avoid having to update this test any time token numbers shift.

4 years agoAvoid reference counting when RETURN CV
Dmitry Stogov [Tue, 2 Jun 2020 21:49:10 +0000 (00:49 +0300)]
Avoid reference counting when RETURN CV

4 years agoAdded missed helper
Dmitry Stogov [Tue, 2 Jun 2020 20:50:32 +0000 (23:50 +0300)]
Added missed helper

4 years agoSkip new test case on Windows when JIT is enabled
Christoph M. Becker [Tue, 2 Jun 2020 15:12:34 +0000 (17:12 +0200)]
Skip new test case on Windows when JIT is enabled

Cf. <http://git.php.net/?p=php-src.git;a=commit;h=c5cf0af8a98cbc574fd315bf9d78033b896886f3>.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 2 Jun 2020 13:19:32 +0000 (15:19 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #73927: phpdbg fails with windows error prompt at "watch array"

4 years agoFix #73927: phpdbg fails with windows error prompt at "watch array"
Christoph M. Becker [Wed, 27 May 2020 16:26:32 +0000 (18:26 +0200)]
Fix #73927: phpdbg fails with windows error prompt at "watch array"

We expect zvals, so we should request zvals.

We also suppress spurious watchpoint removal notices.

4 years agoTracing JIT support for indirect CV modification (may be incomplete)
Dmitry Stogov [Tue, 2 Jun 2020 12:55:18 +0000 (15:55 +0300)]
Tracing JIT support for indirect CV modification (may be incomplete)

4 years agoAfdded misse MAY_BE_ARRAY_* flags
Dmitry Stogov [Tue, 2 Jun 2020 12:54:44 +0000 (15:54 +0300)]
Afdded misse MAY_BE_ARRAY_* flags

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 2 Jun 2020 08:48:15 +0000 (10:48 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79664: PDOStatement::getColumnMeta fails on empty result set

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 2 Jun 2020 08:46:35 +0000 (10:46 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79664: PDOStatement::getColumnMeta fails on empty result set

4 years agoFix #79664: PDOStatement::getColumnMeta fails on empty result set
Christoph M. Becker [Tue, 2 Jun 2020 07:36:39 +0000 (09:36 +0200)]
Fix #79664: PDOStatement::getColumnMeta fails on empty result set

As its name suggests, `sqlite3_data_count` returns the number of
columns in the current row of the result set; we are interested in the
number of columns regardless of the current row, so we have to use
`sqlite3_column_count` instead.

4 years agoAdd some mixed types
Nikita Popov [Tue, 2 Jun 2020 08:15:50 +0000 (10:15 +0200)]
Add some mixed types

4 years agoFixed retutn type inference when return undefined variable
Dmitry Stogov [Mon, 1 Jun 2020 13:26:22 +0000 (16:26 +0300)]
Fixed retutn type inference when return undefined variable

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Mon, 1 Jun 2020 11:25:58 +0000 (13:25 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79650: php-win.exe 100% cpu lockup

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 1 Jun 2020 11:23:59 +0000 (13:23 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79650: php-win.exe 100% cpu lockup

4 years agoFix #79650: php-win.exe 100% cpu lockup
Christoph M. Becker [Sun, 31 May 2020 11:28:09 +0000 (13:28 +0200)]
Fix #79650: php-win.exe 100% cpu lockup

As of PHP 7.3.0, `sapi_cli_single_write()` is supposed to return `< 0`
on failure, but `fwrite()` returns a `size_t`, and signals error by
setting the stream's error indicator.  We have to cater to that.

4 years agoFixed tracing JIT for closure run_time_cache access
Dmitry Stogov [Fri, 29 May 2020 10:58:04 +0000 (13:58 +0300)]
Fixed tracing JIT for closure run_time_cache access

4 years agoFix php_get_args function info return type and add arg check
Ilija Tovilo [Sat, 30 May 2020 21:33:25 +0000 (23:33 +0200)]
Fix php_get_args function info return type and add arg check

Closes GH-5648.

4 years agoAdd UPGRADING note for pty support
Nikita Popov [Sun, 31 May 2020 15:05:42 +0000 (17:05 +0200)]
Add UPGRADING note for pty support

[ci skip]

4 years agoAdd UPGRADING note for xmlrpc unbundling
Nikita Popov [Sun, 31 May 2020 14:57:37 +0000 (16:57 +0200)]
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]

4 years agoFix some line overruns in UPGRADING
Nikita Popov [Sun, 31 May 2020 14:55:46 +0000 (16:55 +0200)]
Fix some line overruns in UPGRADING

[ci skip]

4 years agoMove upgrading note for mixed
Nikita Popov [Sun, 31 May 2020 14:48:14 +0000 (16:48 +0200)]
Move upgrading note for mixed

This should be in the "new features" section.

[ci skip]

4 years agoFix small typo in comment
Daniel Ruf [Sun, 31 May 2020 12:18:19 +0000 (14:18 +0200)]
Fix small typo in comment

4 years agoupdate node-fetch url
Moni [Sat, 30 May 2020 14:29:14 +0000 (16:29 +0200)]
update node-fetch url

4 years agoFix #79653 Unexpected error for ArrayIterator::ksort()
Máté Kocsis [Sat, 30 May 2020 09:06:49 +0000 (11:06 +0200)]
Fix #79653 Unexpected error for ArrayIterator::ksort()

Closes GH-5644

4 years agoUse ZPP callable check for spl_autoload_register.
George Peter Banyard [Thu, 26 Mar 2020 00:00:55 +0000 (01:00 +0100)]
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

4 years agoFix #79652 Ensure that the mixed type is displayed instead of the union of all types
Máté Kocsis [Fri, 29 May 2020 20:31:37 +0000 (22:31 +0200)]
Fix #79652 Ensure that the mixed type is displayed instead of the union of all types

Closes GH-56430

4 years agoUnbundle ext/xmlrpc
Christoph M. Becker [Fri, 29 May 2020 13:43:45 +0000 (15:43 +0200)]
Unbundle ext/xmlrpc

According to <https://wiki.php.net/rfc/unbundle_xmlprc> we unbundle
ext/xmlrpc.

4 years agoAdd upgrading notes about the deprecated functionality in ext/enchant
Máté Kocsis [Fri, 29 May 2020 13:15:27 +0000 (15:15 +0200)]
Add upgrading notes about the deprecated functionality in ext/enchant

[skip ci]

4 years agoConvert enchant resources to opaque objects
Máté Kocsis [Fri, 15 May 2020 06:38:02 +0000 (08:38 +0200)]
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>
4 years agoSupport libzip 1.6 on Windows
Christoph M. Becker [Fri, 29 May 2020 11:42:18 +0000 (13:42 +0200)]
Support libzip 1.6 on Windows

4 years agoFix Windows build
Nikita Popov [Fri, 29 May 2020 10:58:31 +0000 (12:58 +0200)]
Fix Windows build

4 years agoFixed tracing JIT register allocator (failure on ext/opcache/tests/jit/assign_002...
Dmitry Stogov [Fri, 29 May 2020 10:27:47 +0000 (13:27 +0300)]
Fixed tracing JIT register allocator (failure on ext/opcache/tests/jit/assign_002.phpt)

4 years agoAllow tracing JIT generate code when function exits from VM (e.g. for magic __get...
Dmitry Stogov [Fri, 29 May 2020 10:25:59 +0000 (13:25 +0300)]
Allow tracing JIT generate code when function exits from VM (e.g. for magic __get/__set)

4 years agoRemove json checks in fuzzer SAPI
Nikita Popov [Fri, 29 May 2020 10:05:42 +0000 (12:05 +0200)]
Remove json checks in fuzzer SAPI

JSON is now always enabled

4 years agoDon't add guards that are not going to be checked
Dmitry Stogov [Fri, 29 May 2020 09:17:09 +0000 (12:17 +0300)]
Don't add guards that are not going to be checked

4 years agoFixed use-after-free in tracing JIT when recording closures and top-level op_arrays.
Dmitry Stogov [Thu, 28 May 2020 21:45:28 +0000 (00:45 +0300)]
Fixed use-after-free in tracing JIT when recording closures and top-level op_arrays.

4 years agoClean up calls to extension_loaded('json') in tests
Tyson Andre [Thu, 28 May 2020 16:53:12 +0000 (12:53 -0400)]
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

4 years agoFixed tracing JIT type inference for passing undefined CV by value
Dmitry Stogov [Thu, 28 May 2020 15:35:32 +0000 (18:35 +0300)]
Fixed tracing JIT type inference for passing undefined CV by value

4 years agoFixed incorrect trace type inference for top-level code
Dmitry Stogov [Thu, 28 May 2020 14:43:29 +0000 (17:43 +0300)]
Fixed incorrect trace type inference for top-level code

4 years agoFixed incorrect type inference
Dmitry Stogov [Thu, 28 May 2020 14:10:05 +0000 (17:10 +0300)]
Fixed incorrect type inference

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Thu, 28 May 2020 13:35:47 +0000 (15:35 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix PVS-Studio integration

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 28 May 2020 13:34:09 +0000 (15:34 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix PVS-Studio integration

4 years agoFix PVS-Studio integration
Christoph M. Becker [Thu, 28 May 2020 13:20:06 +0000 (15:20 +0200)]
Fix PVS-Studio integration

Without this configuration option, PVS-Studio looks for preprocessed
files (*.i), but these do not exists.

4 years agoBuild fix for newer versions of NetBSD.
David Carlier [Wed, 27 May 2020 22:26:13 +0000 (23:26 +0100)]
Build fix for newer versions of NetBSD.

its libutil contains newer conflicting apis as estrdup, emalloc.

Closes GH-5635

4 years agoEnsure Exception::getFile/getLine return type is correct
Nikita Popov [Thu, 28 May 2020 12:19:47 +0000 (14:19 +0200)]
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.

4 years agoRun Symfony tests in per-component
Nicolas Grekas [Mon, 25 May 2020 11:33:50 +0000 (13:33 +0200)]
Run Symfony tests in per-component

4 years agoRe-enable Symfony test on PHP 8
Nicolas Grekas [Mon, 25 May 2020 08:20:30 +0000 (10:20 +0200)]
Re-enable Symfony test on PHP 8

4 years agoMake Exception::$previous a typed property
Nikita Popov [Thu, 28 May 2020 12:01:29 +0000 (14:01 +0200)]
Make Exception::$previous a typed property

Exception::$previous is a private property, so we can add a type:

    private ?Throwable $previous = null;

4 years agoMake Exception::$trace typed array property
Nikita Popov [Thu, 28 May 2020 10:23:37 +0000 (12:23 +0200)]
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.

4 years agoAvoid recording of uninitialized types.
Dmitry Stogov [Thu, 28 May 2020 11:39:41 +0000 (14:39 +0300)]
Avoid recording of uninitialized types.
VM doesn't set Z_TYPE() for IS_VAR when passes class_entry reference.

4 years agoAdd some mixed parameter types and fix UNKNOWN default values in ext/xmlrpc
Máté Kocsis [Thu, 28 May 2020 10:40:54 +0000 (12:40 +0200)]
Add some mixed parameter types and fix UNKNOWN default values in ext/xmlrpc

4 years agoExtract code for declaring Exception/Error properties
Nikita Popov [Thu, 28 May 2020 10:13:08 +0000 (12:13 +0200)]
Extract code for declaring Exception/Error properties

4 years agoConvert Exception::getMessage() result to string
Nikita Popov [Mon, 25 May 2020 10:10:41 +0000 (12:10 +0200)]
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.

4 years agoSplit "opcache.jit_max_recursion_unroll" into "opcache.jit_max_recursive_calls" and...
Dmitry Stogov [Thu, 28 May 2020 09:28:05 +0000 (12:28 +0300)]
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.

4 years agoFix func info for sodium_crypto_aead_xchacha20poly1305_ietf_decrypt
Nicolas Grekas [Mon, 25 May 2020 12:40:18 +0000 (14:40 +0200)]
Fix func info for sodium_crypto_aead_xchacha20poly1305_ietf_decrypt

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 28 May 2020 08:20:12 +0000 (10:20 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Use automatic port assignment in socket_import/export test

4 years agoUse automatic port assignment in socket_import/export test
Nikita Popov [Thu, 28 May 2020 08:18:01 +0000 (10:18 +0200)]
Use automatic port assignment in socket_import/export test

4 years agoAdd a side exit on enter to function if it may be called with different number of...
Dmitry Stogov [Wed, 27 May 2020 22:22:32 +0000 (01:22 +0300)]
Add a side exit on enter to function if it may be called with different number of arguments.

4 years agoKeep information about SEND_UNPACK/SEND_ARRAY in call_info
Dmitry Stogov [Wed, 27 May 2020 19:15:14 +0000 (22:15 +0300)]
Keep information about SEND_UNPACK/SEND_ARRAY in call_info

4 years agoFixed tracing JIT support for ZEND_RETURN_BY_REF in CALL VM
Dmitry Stogov [Wed, 27 May 2020 15:04:16 +0000 (18:04 +0300)]
Fixed tracing JIT support for ZEND_RETURN_BY_REF in CALL VM

4 years agoFixed tracing JIT for CALL VM
Dmitry Stogov [Wed, 27 May 2020 14:05:06 +0000 (17:05 +0300)]
Fixed tracing JIT for CALL VM

4 years agoRevert "Fixed tracing JIT for CALL VM"
Dmitry Stogov [Wed, 27 May 2020 14:04:31 +0000 (17:04 +0300)]
Revert "Fixed tracing JIT for CALL VM"

This reverts commit 7f3a296f847de74f20f2e1fc64ad6ea706e33a12.

4 years agoalways build json statically
Remi Collet [Wed, 27 May 2020 13:36:07 +0000 (15:36 +0200)]
always build json statically

4 years ago[RFC] Always enable JSON support in php 8.0
Tyson Andre [Wed, 29 Apr 2020 22:35:52 +0000 (18:35 -0400)]
[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

4 years agoFixed tracing JIT for CALL VM
Dmitry Stogov [Wed, 27 May 2020 12:59:29 +0000 (15:59 +0300)]
Fixed tracing JIT for CALL VM

4 years agoMark several phpdbg tests as xfail
Christoph M. Becker [Tue, 26 May 2020 22:25:45 +0000 (00:25 +0200)]
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.

4 years agoAdd support for * width and precision in printf()
Nikita Popov [Tue, 21 Apr 2020 14:54:22 +0000 (16:54 +0200)]
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.

4 years agoMerge branch 'PHP-7.4'
Dmitry Stogov [Wed, 27 May 2020 08:27:34 +0000 (11:27 +0300)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed possible usage of uninitialized value

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Dmitry Stogov [Wed, 27 May 2020 08:26:25 +0000 (11:26 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed possible usage of uninitialized value