Commit Graph

59615 Commits

Author SHA1 Message Date
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Máté Kocsis
b382883696
Indent stubs inside global namespace blocks (#7261) 2021-07-20 10:23:58 +02:00
Nikita Popov
977c3d163f Fix file name clash in curl_copy_handle tests 2021-07-20 09:46:18 +02:00
Máté Kocsis
d9838e5453
Declare tentative return types for ext/dom (#6985) 2021-07-20 09:26:36 +02:00
Máté Kocsis
7a9a37d909
Actually, abstract methods don't have a body 2021-07-20 01:00:10 +02:00
Máté Kocsis
fc0d8983d3
Fix some smaller formatting inconsistencies in stubs 2021-07-20 00:52:26 +02:00
Christoph M. Becker
d2cc7239b7
Merge branch 'PHP-8.0'
* PHP-8.0:
  Revert "Fix #79908: json_encode encodes negative zero as int"
2021-07-20 00:30:37 +02:00
Christoph M. Becker
18abfcb306
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #79908: json_encode encodes negative zero as int"
2021-07-20 00:28:27 +02:00
Christoph M. Becker
2d2c001ca5
Revert "Fix #79908: json_encode encodes negative zero as int"
This reverts commit 717f1ed5e4.
2021-07-20 00:25:50 +02:00
Christoph M. Becker
0ce1cd1370
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81206: Multiple PHP processes crash with JIT enabled
2021-07-19 23:52:51 +02:00
Christoph M. Becker
ef77d3c89f
Fix #81206: Multiple PHP processes crash with JIT enabled
We need to avoid resetting the JIT for all SAPIs, but we need to
initialize the JIT handlers even when only reattaching on Windows.

Closes GH-7208.
2021-07-19 23:45:37 +02:00
Nikita Popov
084d49a262 Set UNION bit for internal class union return type
Fixes assertion failure reported in:
https://github.com/php/php-src/pull/7115#issuecomment-882580767
2021-07-19 16:24:19 +02:00
Nikita Popov
a4db74364d Remove THREAD_LS
This sounds like it will give you a thread local storage, but in
truth ... it does absolutely nothing.
2021-07-19 16:15:31 +02:00
Derick Rethans
84008782d3 Merge branch 'PHP-8.0' 2021-07-19 15:08:21 +01:00
Derick Rethans
9d0fb10823 Merge branch 'PHP-7.4' into PHP-8.0 2021-07-19 15:08:09 +01:00
Derick Rethans
26b1572d37 Move date timezone cache destruction to post deactivate
Some extensions try to use the date features in their own shutdown,
most notably some logging functions. Because of that, move the
cache tear down until after these resources have been cleaned up.
2021-07-19 15:07:01 +01:00
Nikita Popov
814a932734 Add ZEND_ACC_NOT_SERIALIZABLE flag
This prevents serialization and unserialization of a class and its
children in a way that does not depend on the zend_class_serialize_deny
and zend_class_unserialize_deny handlers that will be going away
in PHP 9 together with the Serializable interface.

In stubs, `@not-serializable` can be used to set this flag.

This patch only uses the new flag for a handful of Zend classes,
converting the remainder is left for later.

Closes GH-7249.
Fixes bug #81111.
2021-07-19 15:59:11 +02:00
David Carlier
ffc30c5b8d getrandom support for DragonFlyBSD too.
supported since the 5.7.x release, actually 5.8.x is the stable one.
2021-07-19 15:12:43 +02:00
Kamil Tekiela
052af90b86 Deprecate autovivification on false
Deprecate automatically converting "false" into an empty array
on write operands. Autovivification continues to be supported
for "null" values, as well as undefined/uninitialized values.

RFC: https://wiki.php.net/rfc/autovivification_false

Closes GH-7131.

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 14:49:37 +02:00
Nikita Popov
c2a58ab07d Throw DomException for DOM out-of-memory error conditions
A number of error conditions in DOM can only occur if libxml2 runs
out of memory, at least as far as I can see. In such cases we
currently do a silent "return false", which violates the DOM spec,
and which code is very unlikely to handle sensibly.

Switch these to throw a DomException with INVALID_STATE_ERR type.
This error type is chosen because we use for similar checks
elsewhere, for example:
a733b1ada7/ext/dom/documentfragment.c (L45-L48)

This changes some of the more obvious cases I spotted, but there are probably more.

Closes GH-7049.
2021-07-19 14:43:31 +02:00
Dmitry Stogov
28f6a2ba6e Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid ASAN integer overflow warnings
2021-07-19 14:55:07 +03:00
Dmitry Stogov
15abbea5e7 Avoid ASAN integer overflow warnings 2021-07-19 14:53:23 +03:00
Dmitry Stogov
de1a1d5a36 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed incorrec immediate encoding when using LEA optimization
2021-07-19 14:53:09 +03:00
Hao Sun
c5d93aeee9 Fixed incorrec immediate encoding when using LEA optimization 2021-07-19 14:51:08 +03:00
Máté Kocsis
75a678a7e3
Declare tentative return types for Zend (#7251)
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 13:44:20 +02:00
Alex Dowad
26fc7c4256 Fix typo in mbfilter.h
As pointed out by Bruno Haible (https://haible.de/bruno).
2021-07-19 12:17:00 +02:00
Alex Dowad
13136a575d Fix conversion of GB18030 text (and add test suite)
- Truncated multi-byte characters are treated as an error
- Reject GB18030 4-byte codes which translate to (non-existent)
  Unicode codepoints above 0x10FFFF
- Add a number of missing mappings from the GB18030 standards
  (These mappings are supported by iconv. I don't know why they were
  missing from mbstring.)
2021-07-19 12:17:00 +02:00
Alex Dowad
340164bcc9 Reduce size of conversion tables for CP936 2021-07-19 12:17:00 +02:00
Alex Dowad
73c6a5b89d Fix conversion of Big5 and CP950 text (and add test suite)
- Truncated multi-byte characters are treated as an error
- Follow recommended mappings from Unicode consortium
2021-07-19 12:17:00 +02:00
Máté Kocsis
e120d5269a
Deprecate oci8.old_oci_close_semantics (#7258) 2021-07-19 11:56:46 +02:00
Dmitry Stogov
66328742ea Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #81249 (Intermittent property assignment failure with JIT enabled)
2021-07-19 12:14:55 +03:00
Dmitry Stogov
c0e4932816 Fixed bug #81249 (Intermittent property assignment failure with JIT enabled) 2021-07-19 12:11:09 +03:00
Dmitry Stogov
58fb147cde Merge branch 'PHP-8.0'
* PHP-8.0:
  Skip test on 32-bit system
2021-07-19 10:51:10 +03:00
Dmitry Stogov
ee981619ce Skip test on 32-bit system 2021-07-19 10:49:43 +03:00
Dmitry Stogov
3621ce60e4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #81225 (Wrong result with pow operator with JIT enabled)
2021-07-19 10:43:08 +03:00
Dmitry Stogov
9cd437138e Fixed bug #81225 (Wrong result with pow operator with JIT enabled) 2021-07-19 10:39:52 +03:00
Nikita Popov
edb6b375dd Don't return bool from Phar::offsetUnset()
This violates the ArrayAccess interface. Use offsetExists() to
check if an entry exists.
2021-07-16 16:39:27 +02:00
Nikita Popov
b9893c2a18 Actually add the tentative type marker... 2021-07-16 16:33:47 +02:00
Nikita Popov
cad6144d18 Add minimial tentative types to dom
Just for implementations of Countable. These (no longer) suffer
from an overly broad return type.
2021-07-16 16:32:12 +02:00
Nikita Popov
4cf0269e4e DOMNamedNodeMap::count() cannot return false 2021-07-16 16:27:53 +02:00
Nikita Popov
f089e8afbd DOMNodeList::count() cannot return false
Refactor the implementation to make this obvious, and make use
of early returns.
2021-07-16 16:22:52 +02:00
Christoph M. Becker
d66854bece
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #78238: BCMath returns "-0"
2021-07-16 16:01:03 +02:00
Christoph M. Becker
9fbcaa57aa
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78238: BCMath returns "-0"
2021-07-16 15:56:15 +02:00
Christoph M. Becker
bcb89c75ec
Fix #78238: BCMath returns "-0"
There is no negative zero in the decimal system, so we must suppress
the sign.

Closes GH-7250.
2021-07-16 15:54:24 +02:00
Nikita Popov
a733b1ada7 Restore zend_atoi()
I dropped this in preparation for changes that I didn't end up
doing. Restore the function for now to avoid unnecessary churn for
extensions.
2021-07-16 14:46:56 +02:00
Nikita Popov
4423253700 Fix deprecation warnings in phar.php 2021-07-16 14:19:01 +02:00
David Carlier
4c873df7d5 sockets enabling SO_MARK socket option which is relatively similar
to FreeBSD's SO_USER_COOKIE giving a socket an identifier for packet filter,
 giving a specific route table.
2021-07-16 12:18:24 +02:00
Máté Kocsis
b3e0888129
Declare tentative return types in ext/spl - part 3 (#7239) 2021-07-16 12:09:05 +02:00
Nikita Popov
f2e374c881 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #81265: getimagesize returns 0 for 256px ICO images
2021-07-16 10:07:35 +02:00
Nikita Popov
12a858ac95 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81265: getimagesize returns 0 for 256px ICO images
2021-07-16 10:07:26 +02:00