Commit Graph

117086 Commits

Author SHA1 Message Date
Christoph M. Becker
7426e3b6a1 Bump required libcurl version to 7.29.0
libcurl 7.29.0 has been released almost eight years ago, so this
version is supposed to be available practically everywhere.  This bump
also allows us to get rid of quite some conditional code and tests
catering to very old libcurl versions.
2020-01-19 14:10:46 +01:00
Tyson Andre
3c72105edb Remove leftover ZEND_CAST code for (unset) cast.
Followup for d74d3922ce

Attempting to require a file with (unset) casts results in an E_COMPILE_ERROR
that can't be caught or handled by set_exception_handler/set_error_handler.

Also remove the (bool) cast, because the ZEND_BOOL opcode handles that.

Remove inference that array -> object cast can throw.
It was added in 2a286ad599 - I don't know how creating an stdClass would throw.
(numeric keys, references, etc. don't cause it to throw)

Closes GH-5042
2020-01-18 11:06:19 -05:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Nikita Popov
117b18d22d Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79115
2020-01-17 11:38:18 +01:00
Nikita Popov
384dfe331b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79115
2020-01-17 11:38:10 +01:00
Nikita Popov
07bda97e76 Fixed bug #79115 2020-01-17 11:37:35 +01:00
Nikita Popov
9ec1ee5976 Add support for deprecating constants
Internal constants can be marked as CONST_DEPRECATED, in which
case accessing them will throw a deprecation warning.

For now this is only supported on global constants, not class
constants. Complain to me if you need to deprecate a class
constant...

Closes GH-5072.
2020-01-17 10:05:06 +01:00
Nikita Popov
ae706e51e1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Update php.ini files to add missing FTP extension
2020-01-17 09:51:31 +01:00
aand18
4d24f5a494 Update php.ini files to add missing FTP extension
FTP functionality isn't enabled by default and not listed as a disabled
extension in the `php.ini` file either.

This should spare a few googles to anyone needing FTP functionality in PHP.

Closes GH-5084.
2020-01-17 09:51:18 +01:00
Nikita Popov
75aa5bfa9e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #71876
2020-01-17 09:48:50 +01:00
Nikita Popov
9f65afca71 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #71876
2020-01-17 09:48:42 +01:00
Nikita Popov
018251a7c4 Fixed bug #71876
This is a backport of fcdc0a6db0
to the PHP-7.3 branch. We need to make sure that OnUpdateString
is also called for a NULL value, otherwise the reset of the encoding
at the end of the request will not work.

I believe I already tried to land this before once, but it didn't
actually end up on the PHP-7.3 branch due to a push conflict that
I only noticed just now.
2020-01-17 09:47:31 +01:00
Nikita Popov
43719022ea Improve SSA representation of FE_FETCH
The op2 of FE_FETCH is only written if the loop edge is taken.
Fix up the SSA form to use the pre-assignment value if the exit
edge is taken.

This allows us to properly infer the type of the loop variable,
without letting the pre-loop type leak in.

Closes GH-5040.
2020-01-17 09:41:27 +01:00
Nikita Popov
bd1977282c Use zend_type inside type lists
Instead of having a completely independent encoding for type list
entries. This is going to use more memory, but I'm not particularly
concerned about that, as type unions that contain multiple classes
should be uncommon. On the other hand, this allows us to treat
top-level types and types inside lists mostly the same.

A new ZEND_TYPE_FOREACH macros allows to transparently treat list
and non-list types the same way. I'm not using it everywhere it could be
used for now, just the places that seemed most obvious.

Of course, this will make any future type system changes much simpler,
as it will not be necessary to duplicate all logic two times.
2020-01-17 09:37:54 +01:00
Máté Kocsis
afdaa91170
Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Nikita Popov
1fa6f03265 Fix reflection leak if type inside type list is resolved 2020-01-16 15:30:24 +01:00
Christoph M. Becker
1e62e627fd Merge branch 'PHP-7.4'
* PHP-7.4:
  Disable optimizations for ASan instrumented builds
2020-01-16 13:58:28 +01:00
Christoph M. Becker
c9908ee5eb Disable optimizations for ASan instrumented builds
ASan instrumentation does not support the MSVC debug runtime, but still
it does not make sense to enable optimizations for such builds, since
they are not meant for production usage anyway, and although memory
corruption issues are still found in optimized builds, the generated
diagnostics are close to being useless, and apparently sometimes even
outright wrong.  Therefore, we disable all optimizations for ASan
instrumented builds.

We also introduce and use `ZEND_WIN32_NEVER_INLINE` for ASan enabled
builds to avoid inlining of functions, so we get even better
diagnostics.
2020-01-16 13:57:21 +01:00
Máté Kocsis
c3cf01b553
Fix #78880: Yet another batch of spelling errors 2020-01-16 12:04:00 +01:00
Máté Kocsis
0b4778c377
Fix #78880: Another bunch of spelling errors 2020-01-16 09:46:47 +01:00
Christoph M. Becker
9d7e03c325 Remove useless skip check
As of PHP 5.4.0, `detect_unicode` is always available, so this check
cannot fail.
2020-01-15 18:38:15 +01:00
Christoph M. Becker
5d3be966f9 Use proper printf() specifiers 2020-01-15 18:18:36 +01:00
George Peter Banyard
9118a96fb0 Remove va_copy from zend_portability as it's always available since C99 2020-01-14 22:56:03 +01:00
Christoph M. Becker
f6fbe13717 Rename run-test.php to run-tests.php in the test packs
In the php-src repository, the test runner is named run-tests.php, but
when it is copied to the tests packs, it is renamed to run-test.php.
This renaming does not make sense, and is actually somewhat confusing.
Although changing the name back to run-tests.php constitutes a BC
break, we think the benefit of having a single name outweights the
disadvantages in the long run.
2020-01-14 18:31:25 +01:00
Christoph M. Becker
03bd4333f6 Add imagegetinterpolation()
While `imagesetinterpolation()` is available as of PHP 5.5.0,
there is no according getter function, so users would have to track the
current interpolation method manually.

To remedy this, we introduce `imagegetinterpolation()` as thin wrapper
for `gdImageGetInterpolationMethod()` (which has been introduced with
libgd 2.1.1), and use `im->interpolation_id` as fallback for older
libgd.  Since our bundled libgd does not yet have this function, we add
it.

We also simplify the recently introduced bug79068.phpt, where it is
sufficient to check that the interpolation method has not been changed.
2020-01-14 18:25:27 +01:00
Christoph M. Becker
127d6f3f39 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79096: FFI Struct Segfault
2020-01-14 16:47:24 +01:00
Christoph M. Becker
05f3cd23ed Fix #79096: FFI Struct Segfault
We must not assume that the size of a function's return value is at
most `sizeof(ffi_arg)`, but rather have to use the size which already
has been determined for the return type if it is larger than
`sizeof(ffi_arg)`.

To be able to have a regression test, we export the required test
function from the zend-test extension, and make sure that the test
can be run on different platforms regardless of whether zend-tests was
built statically or dynamically.
2020-01-14 16:46:58 +01:00
Dmitry Stogov
77bf144d52 Inline hot parts of bitwise instructions into hybrid VM 2020-01-14 13:47:10 +03:00
Christoph M. Becker
7232779fca Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79106: PDO may fetch wrong column indexes with PDO::FETCH_BOTH
2020-01-13 18:49:38 +01:00
Christoph M. Becker
ed78c6dbae Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79106: PDO may fetch wrong column indexes with PDO::FETCH_BOTH
2020-01-13 18:48:55 +01:00
Christoph M. Becker
30ce242435 Fix #79106: PDO may fetch wrong column indexes with PDO::FETCH_BOTH
Column names can be numeric strings, so we have to make sure to insert
the column values with the appropriate numeric keys, instead of adding
them.
2020-01-13 18:47:54 +01:00
Dmitry Stogov
8ee04946f0 typo 2020-01-13 16:25:42 +03:00
Christoph M. Becker
8ea190ba95 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
2020-01-13 13:24:12 +01:00
Christoph M. Becker
b0cdd8cc53 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
2020-01-13 13:23:12 +01:00
Christoph M. Becker
1752393bb4 Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
Column names can be numeric strings, so we have to make sure to insert
the column values with the appropriate numeric keys, instead of adding
them.
2020-01-13 13:21:45 +01:00
Nikita Popov
dc02e68f77 Try to fix ZTS build 2020-01-13 13:12:55 +01:00
Nikita Popov
d2110e9880 Use helper in one more place 2020-01-13 12:44:16 +01:00
Nikita Popov
862a4f3a5e Fix build 2020-01-13 12:42:51 +01:00
Dmitry Stogov
27815959e1 Improve access to zend_map_ptr data 2020-01-13 14:27:35 +03:00
Nikita Popov
1caf0951a0 Handle one more case I missed 2020-01-13 12:06:23 +01:00
Nikita Popov
5d869df753 Make class name references use the class_name production
Throw a compile error for "static" references instead, where it
isn't already the case.

Also extract the code that does that -- we have quite a few places
where we get a const class ref and require it to be default.
2020-01-13 11:51:09 +01:00
Nikita Popov
2a3e37a496 Don't use yystrlen()
This is unnecessary and not available when GLR is used.
2020-01-13 11:23:30 +01:00
Islam Israfilov
f553e676ec Fixed #78385: Distinguish absent/empty query/fragment
http://example.com/foo   => query = null, fragment = null
http://example.com/foo?  => query = "",   fragment = null
http://example.com/foo#  => query = null, fragment = ""
http://example.com/foo?# => query = "",   fragment = ""

Closes GH-5078.
2020-01-13 10:18:23 +01:00
Nikita Popov
4388add2c8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test
2020-01-13 10:10:16 +01:00
Nikita Popov
c247898949 Fix test
Hopefully (32-bit)
2020-01-13 10:09:58 +01:00
Christoph M. Becker
c1519321e7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Bring back test case support for older MySQL versions
2020-01-11 11:22:30 +01:00
Christoph M. Becker
0ab53f1636 Bring back test case support for older MySQL versions
These test cases have recently been adjusted to work with MySQL 8[1],
but some older, but still supported database versions, such as MySQL
5.6, still need the password to be sent hashed, so we fall back to
using `PASSWORD()`, if the `SET PASSWORD` query fails without it.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b0efd18f7844da29931737b8a1cf461c7493e168>.
2020-01-11 11:21:26 +01:00
George Peter Banyard
1589266f85 Remove dead code and unused DEFINEs
Closes GH-5073
2020-01-10 22:24:15 +01:00
Christoph M. Becker
7c76126841 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test cases which fail on Windows debug builds
2020-01-10 20:02:16 +01:00
Christoph M. Becker
1ef8d5d65b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test cases which fail on Windows debug builds
2020-01-10 20:01:28 +01:00