]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 14 Aug 2020 08:42:14 +0000 (10:42 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Add missing initialization check to RegexIterator::getRegex()

4 years agoAdd missing initialization check to RegexIterator::getRegex()
Nikita Popov [Fri, 14 Aug 2020 08:27:09 +0000 (10:27 +0200)]
Add missing initialization check to RegexIterator::getRegex()

4 years agoFix test after is_callable change
Nikita Popov [Fri, 14 Aug 2020 08:40:20 +0000 (10:40 +0200)]
Fix test after is_callable change

4 years agoFix bug #78770
Nikita Popov [Fri, 14 Aug 2020 08:22:42 +0000 (10:22 +0200)]
Fix bug #78770

Refactor the zend_is_callable implementation to check callability
at a particular frame (this is an implementation detail for now,
but could be exposed in the API if useful). Pick the first parent
user frame as the one to check.

4 years agoFix ZPP for mhash()
Máté Kocsis [Thu, 13 Aug 2020 21:57:23 +0000 (23:57 +0200)]
Fix ZPP for mhash()

Closes GH-5985

4 years agoUse ZPP callable check for ldap_set_rebind_proc()
George Peter Banyard [Wed, 8 Jul 2020 16:44:34 +0000 (18:44 +0200)]
Use ZPP callable check for ldap_set_rebind_proc()

4 years agoUse ZPP callable check for Windows specific functions
George Peter Banyard [Wed, 8 Jul 2020 16:37:01 +0000 (18:37 +0200)]
Use ZPP callable check for Windows specific functions

4 years agoAllow number_format to be only passed 3 arguments
George Peter Banyard [Wed, 12 Aug 2020 17:26:54 +0000 (19:26 +0200)]
Allow number_format to be only passed 3 arguments

Closes GH-5977

4 years agoColorize --show-diff, only on stdout
Tyson Andre [Wed, 12 Aug 2020 23:27:00 +0000 (19:27 -0400)]
Colorize --show-diff, only on stdout

Don't add colors to the saved `.diff` file.

Related to a41cf3e1d2ed3ae38ad6115a8b65e5f14dae0b49

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 13 Aug 2020 15:26:20 +0000 (17:26 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79724

4 years agoFixed bug #79724
Nikita Popov [Thu, 13 Aug 2020 09:45:05 +0000 (11:45 +0200)]
Fixed bug #79724

4 years agoAdd some missing DatePeriod initialization checks
Nikita Popov [Thu, 13 Aug 2020 15:18:50 +0000 (17:18 +0200)]
Add some missing DatePeriod initialization checks

4 years agoAdd a missing null check in simplexml
Nikita Popov [Thu, 13 Aug 2020 14:34:56 +0000 (16:34 +0200)]
Add a missing null check in simplexml

4 years agoFix invalid zpp calls in pcntl_get/setpriority
Nikita Popov [Thu, 13 Aug 2020 14:32:43 +0000 (16:32 +0200)]
Fix invalid zpp calls in pcntl_get/setpriority

4 years agoFix test after PDOStatement::fetchObject() change
Nikita Popov [Thu, 13 Aug 2020 14:45:32 +0000 (16:45 +0200)]
Fix test after PDOStatement::fetchObject() change

4 years agoUse zpp C in pg_fetch_object
Nikita Popov [Thu, 13 Aug 2020 14:24:08 +0000 (16:24 +0200)]
Use zpp C in pg_fetch_object

4 years agoUse Z_PARAM_CLASS in PDOStatement::fetchObject()
Nikita Popov [Thu, 13 Aug 2020 14:20:29 +0000 (16:20 +0200)]
Use Z_PARAM_CLASS in PDOStatement::fetchObject()

Instead of implementing custom logic.

4 years agoThrow Error on uninitialized XMLWriter
Nikita Popov [Thu, 13 Aug 2020 14:11:16 +0000 (16:11 +0200)]
Throw Error on uninitialized XMLWriter

4 years agoThrow on uninitialized SimpleXMLElement
Nikita Popov [Thu, 13 Aug 2020 13:52:17 +0000 (15:52 +0200)]
Throw on uninitialized SimpleXMLElement

Elevate this warning into an Error, as usual. Add a few checks
in places that were missing them.

4 years agoAvoid fatal error on not found class in mysqli_fetch_object()
Nikita Popov [Thu, 13 Aug 2020 12:59:39 +0000 (14:59 +0200)]
Avoid fatal error on not found class in mysqli_fetch_object()

Instead use C zpp modifier and throw TypeError.

4 years agoCheck missing parameter types in stubs
Máté Kocsis [Thu, 30 Jul 2020 12:31:47 +0000 (14:31 +0200)]
Check missing parameter types in stubs

[skip ci] Closes GH-5627

4 years agoFix param name in PHPDoc
Máté Kocsis [Thu, 13 Aug 2020 12:54:48 +0000 (14:54 +0200)]
Fix param name in PHPDoc

4 years agoAdd all the missing parameter types to stubs
Máté Kocsis [Fri, 7 Aug 2020 19:50:02 +0000 (21:50 +0200)]
Add all the missing parameter types to stubs

Closes GH-5955

4 years agoUse a dedicated method for MultipleIterator::countIterators()
Nikita Popov [Thu, 13 Aug 2020 12:39:38 +0000 (14:39 +0200)]
Use a dedicated method for MultipleIterator::countIterators()

This method has a different signature from
SplObjectStorage::count(), so don't share implementations.

4 years agoReplace fatal error in SplFileInfo with exception
Nikita Popov [Thu, 13 Aug 2020 12:35:11 +0000 (14:35 +0200)]
Replace fatal error in SplFileInfo with exception

Using RuntimeException here, because the same error condition
uses that in many other places in this file.

4 years agoThrow Error exception in DOM_GET_OBJ
Nikita Popov [Thu, 13 Aug 2020 11:15:38 +0000 (13:15 +0200)]
Throw Error exception in DOM_GET_OBJ

Per general convention for handling of uninitialized objects.

4 years agoSwitch to mime-db as source of extension => MIME map
Nikita Popov [Wed, 24 Jun 2020 15:00:32 +0000 (17:00 +0200)]
Switch to mime-db as source of extension => MIME map

The Apache MIME type map is not actively maintained anymore, so
this switches to jshttp/mime-db, which seems to be the de-facto
standard in this area now. This avoid the need to patch in our
own MIME types over time.

The preference algorithm is based on:
https://github.com/jshttp/mime-types/blob/47b62ac45e9b176a2af35532d0eea4968bb9eb6d/index.js#L154

Closes GH-5764.

4 years agoMake strftime tests musl compatible
Nikita Popov [Wed, 12 Aug 2020 15:06:02 +0000 (17:06 +0200)]
Make strftime tests musl compatible

 * Remove usage of strftime() in favor of date() in cases where
   we are not specifically testing strftime(). We implement
   date() ourselves, and as such are insulated from implementation-
   defined behavior.
 * Add skipif for broken strftime() %Z support. We have decided
   not to work around the issue for musl using manual expansion,
   as people should not be using this function anyway, and it is
   slated for future deprecation.
 * Don't test strftime() with invalid format specifier. The
   behavior is implementation-dependent.

4 years agofix test expectation
Remi Collet [Thu, 13 Aug 2020 07:36:42 +0000 (09:36 +0200)]
fix test expectation

4 years agoDrop redundant arg count check
George Peter Banyard [Thu, 13 Aug 2020 00:37:00 +0000 (02:37 +0200)]
Drop redundant arg count check

4 years agoSupport NO_COLOR environment variable in run-tests.php
Tyson Andre [Sun, 9 Aug 2020 15:26:51 +0000 (11:26 -0400)]
Support NO_COLOR environment variable in run-tests.php

And add a --color option for run-tests.php

See https://no-color.org/

> an informal standard is hereby proposed:
>
> All command-line software which outputs text with ANSI color added should check
> for the presence of a `NO_COLOR` environment variable that, when present
> (regardless of its value), prevents the addition of ANSI color.

4 years agoRecognize gnu-libiconv location on alpine
Nikita Popov [Fri, 7 Aug 2020 10:15:06 +0000 (12:15 +0200)]
Recognize gnu-libiconv location on alpine

4 years agoFix crypt_r detection under BSD system
David Carlier [Mon, 10 Aug 2020 20:16:10 +0000 (21:16 +0100)]
Fix crypt_r detection under BSD system

For BSD systems, crypt.h does not exist, instead we need to
include unistd.h.

Closes GH-5971.

4 years agoSmall CS fix
Nyholm [Wed, 12 Aug 2020 07:33:28 +0000 (09:33 +0200)]
Small CS fix

The comments were incorrectly aligned. Fix this by dropping the
alignment and moving the comments before the declarations.

Closes GH-5975.

4 years agoDisable report_zend_debug by default
Nikita Popov [Wed, 12 Aug 2020 08:32:05 +0000 (10:32 +0200)]
Disable report_zend_debug by default

We might just want to drop this completely, but at least don't
enable it by default. It already gets disabled by a number of
SAPIs, but we should make that the default state.

4 years agoRename standard array function parameters to $array
Tyson Andre [Mon, 10 Aug 2020 23:48:41 +0000 (19:48 -0400)]
Rename standard array function parameters to $array

This is targeting 8.0.

`$arg` seems like a poor choice of a name,
especially if the function were to have arguments added.

In many cases, the php.net documentation already has $array for these functions.
E.g. https://www.php.net/manual/en/function.array-intersect.php

I'd assume that since named arguments was added to 8.0 near the feature freeze,
PHP's maintainers had planned to make the names consistent
and gradually use the same name for  docs and implementation.

4 years agoFix ?-> in encaps vars without braces
Ilija Tovilo [Sun, 9 Aug 2020 17:24:44 +0000 (19:24 +0200)]
Fix ?-> in encaps vars without braces

Closes GH-5966.

4 years agoDrop php_pdo_get_exception_base() function
Nikita Popov [Tue, 11 Aug 2020 15:24:03 +0000 (17:24 +0200)]
Drop php_pdo_get_exception_base() function

This API is more confusing than helpful.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 11 Aug 2020 15:13:32 +0000 (17:13 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 11 Aug 2020 15:13:00 +0000 (17:13 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails

4 years agoFix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
Ahmed Abdou [Sun, 17 Feb 2019 21:59:00 +0000 (22:59 +0100)]
Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails

PDO driver constructors are throwing PdoException without setting
errorInfo, so create a new reusable function that throws exceptions
for PDO and will also set the errorInfo. Use this function in
pdo_mysql, pdo_sqlite, and pdo_pgsql.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 11 Aug 2020 14:29:01 +0000 (16:29 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix bug #75785 by attempt switching endianness on Maker's Note

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 11 Aug 2020 14:26:55 +0000 (16:26 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix bug #75785 by attempt switching endianness on Maker's Note

4 years agoFix bug #75785 by attempt switching endianness on Maker's Note
Nawarian [Sun, 12 Jul 2020 19:53:52 +0000 (21:53 +0200)]
Fix bug #75785 by attempt switching endianness on Maker's Note

Different manufacturer models may come with a
different endianness (motorola/intel) format. In
order to avoid a big refactor and a gigantic lookup
table, this commit simply attempts to switch the
endianness and proceed when values are acceptable.

Closes GH-5849.

4 years agoFixed bug #79927
Nikita Popov [Tue, 11 Aug 2020 13:48:40 +0000 (15:48 +0200)]
Fixed bug #79927

We need to unset the AT_FIRST_YIELD flag when yielding from an
array as well.

In the interest of being conservative, I'm applying this only to
PHP 8.

4 years agoFix nullsafe operator on $this
Nikita Popov [Tue, 11 Aug 2020 13:22:14 +0000 (15:22 +0200)]
Fix nullsafe operator on $this

4 years agoSAVE_OPLINE in NULL_HANDLER
Nikita Popov [Tue, 11 Aug 2020 13:14:50 +0000 (15:14 +0200)]
SAVE_OPLINE in NULL_HANDLER

Let's avoid crashing before the nice error message gets printed...

4 years agoFix nullsafe operator on reference
Nikita Popov [Tue, 11 Aug 2020 13:11:36 +0000 (15:11 +0200)]
Fix nullsafe operator on reference

Dereference the value before checking the type. As the happy path
necessarily has to check for references, I'm not bothering to
delay the comparison.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 11 Aug 2020 12:59:04 +0000 (14:59 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79917

4 years agoFixed bug #79917
Nikita Popov [Tue, 11 Aug 2020 12:42:13 +0000 (14:42 +0200)]
Fixed bug #79917

op_arrays can be shared on two levels: Either the op_array is
completely shared, or it is distinct but shares all members
(apart from static_variables).

The the op_array is distinct, we need to make sure to properly
initialize the MAP_PTR structures.

4 years agoAutogenerate function entries for COMPersistHelper
Christoph M. Becker [Tue, 11 Aug 2020 08:17:43 +0000 (10:17 +0200)]
Autogenerate function entries for COMPersistHelper

Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
4 years agoRemove practically unused parameter
Christoph M. Becker [Tue, 11 Aug 2020 09:37:52 +0000 (11:37 +0200)]
Remove practically unused parameter

The `cached` out parameter of `php_com_load_typelib_via_cache()` was
meant to signal whether a particular typelib actually has been cached.
This is not really relevant, though, for the imagined purposes, and
since the parameter is no longer really used, we removed it altohether.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Tue, 11 Aug 2020 09:28:41 +0000 (11:28 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #48585: com_load_typelib holds reference, fails on second call

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 11 Aug 2020 09:27:50 +0000 (11:27 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #48585: com_load_typelib holds reference, fails on second call

4 years agoFix #48585: com_load_typelib holds reference, fails on second call
Christoph M. Becker [Tue, 4 Aug 2020 16:25:50 +0000 (18:25 +0200)]
Fix #48585: com_load_typelib holds reference, fails on second call

Whether the type library is cached is actually irrelevant here; what
matters is that the symbols are imported, and since these are not
cached, we have to import them for every request.  And we cannot cache
the symbols, because the import depends on the current codepage, but
the codepage is a `PHP_INI_ALL` setting.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 11 Aug 2020 08:35:59 +0000 (10:35 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79951

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 11 Aug 2020 08:35:17 +0000 (10:35 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #79951

4 years agoFixed bug #79951
Nikita Popov [Tue, 11 Aug 2020 08:33:59 +0000 (10:33 +0200)]
Fixed bug #79951

One branch did not release tmp_replace_entry_str.

Also reduce the scope of some variables.

4 years agoRemove unnecessary function entry array
Máté Kocsis [Tue, 11 Aug 2020 07:40:14 +0000 (09:40 +0200)]
Remove unnecessary function entry array

4 years agoMerge branch 'PHP-7.4'
George Wang [Mon, 10 Aug 2020 23:11:48 +0000 (19:11 -0400)]
Merge branch 'PHP-7.4'

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
George Wang [Mon, 10 Aug 2020 23:11:26 +0000 (19:11 -0400)]
Merge branch 'PHP-7.3' into PHP-7.4

4 years agoMake sure string is NUL byte terminated.
George Wang [Mon, 10 Aug 2020 23:11:03 +0000 (19:11 -0400)]
Make sure string is NUL byte terminated.

4 years agoFix signature of callback function
Christoph M. Becker [Mon, 10 Aug 2020 17:42:05 +0000 (19:42 +0200)]
Fix signature of callback function

Cf. <https://docs.microsoft.com/en-us/windows/win32/api/imagehlp/nc-imagehlp-pimagehlp_status_routine>.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 10 Aug 2020 19:53:26 +0000 (21:53 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Check the correct list

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Mon, 10 Aug 2020 19:53:20 +0000 (21:53 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Check the correct list

4 years agoCheck the correct list
Nikita Popov [Mon, 10 Aug 2020 19:52:36 +0000 (21:52 +0200)]
Check the correct list

This was supposed to check mx_list, not weight_list... oops.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 10 Aug 2020 18:43:24 +0000 (20:43 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix bug #79944

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Mon, 10 Aug 2020 18:43:04 +0000 (20:43 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix bug #79944

4 years agoFix bug #79944
Nikita Popov [Mon, 10 Aug 2020 14:53:31 +0000 (16:53 +0200)]
Fix bug #79944

Only return true from dns_get_mx if we actually found any MX record.

4 years agoSkip bug70417.phpt if lsof output looks wrong
Nikita Popov [Mon, 10 Aug 2020 12:36:06 +0000 (14:36 +0200)]
Skip bug70417.phpt if lsof output looks wrong

On alpine lsof accepts -p but it doesn't actually do anything.
Add a crude check for whether lsof looks like Linux lsof.

4 years agoCheck permissions in pcntl_unshare_03.phpt
Nikita Popov [Mon, 10 Aug 2020 12:20:37 +0000 (14:20 +0200)]
Check permissions in pcntl_unshare_03.phpt

4 years agoDon't check specific message in socket_shutdown.phpt
Nikita Popov [Mon, 10 Aug 2020 12:19:04 +0000 (14:19 +0200)]
Don't check specific message in socket_shutdown.phpt

4 years agoOnly test one error in socket_strerror() test
Nikita Popov [Wed, 5 Aug 2020 09:31:31 +0000 (11:31 +0200)]
Only test one error in socket_strerror() test

The messages differ by used libc and version, so let's not try to
do exhaustive testing here.

4 years agoFixed bug #62294
Nikita Popov [Mon, 10 Aug 2020 10:54:02 +0000 (12:54 +0200)]
Fixed bug #62294

The primary issue was already resolved in 7c3e487289ec41e560cf7a77e36eb43da2234f33,
but the particular example used in this bug report ran into an
additional issue on PHP 8, because I forgot to drop a number of
zend_bailout calls when switch require failure to throw.

4 years agoFixed bug #65275
Nikita Popov [Mon, 10 Aug 2020 10:39:19 +0000 (12:39 +0200)]
Fixed bug #65275

Make EG(exit_status) the single source of truth for the exit status,
instead of having two variables that we cannot really keep
synchronized.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Mon, 10 Aug 2020 10:27:33 +0000 (12:27 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #79922: Crash after multiple calls to xml_parser_free()

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 10 Aug 2020 10:25:08 +0000 (12:25 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79922: Crash after multiple calls to xml_parser_free()

4 years agoFix #79922: Crash after multiple calls to xml_parser_free()
Christoph M. Becker [Mon, 10 Aug 2020 08:40:31 +0000 (10:40 +0200)]
Fix #79922: Crash after multiple calls to xml_parser_free()

We must not call `zend_list_delete()` in resource closer functions
exposed to userland, because decreasing the refcount there leads to
use-after-free scenarios.  In this case, commit 4a42fbb worked for
typical use-cases where `xml_parser_free()` has been called exactly
once for the resource, because there is an internal zval (`->index`)
referencing the same resource which already increased the refcount by
one.  However, when `xml_parser_free()` is called multiple times on the
same XML parser resource, the resource would be freed prematurely.

Instead we forcefully close the resource in `xml_parser_free()`.  We
also could decrease the refcount of the resource there, but that would
require to call `xml_parser_free()` which is somewhat uncommon, and
would be particularly bad wrt. PHP 8 where that function is a NOP, and
as such doesn't have to be called.  So we do no longer increase the
refcount of the resource when copying it to the internal zval, and let
the usualy refcounting semantics take care of the resource destruction.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=4a42fbbbc73aad7427aef5c89974d1833636e082>

4 years agoRemove some unnnecessary null checks in openssl
Nikita Popov [Mon, 10 Aug 2020 10:09:38 +0000 (12:09 +0200)]
Remove some unnnecessary null checks in openssl

Remove null checks before EVP_PKEY_free and BIO_free. NULL is a
no-op for both of these. Probably applies to most other freeing
function as well...

4 years agoImprove X509_PKEY management in OpenSSL
Nikita Popov [Thu, 6 Aug 2020 11:18:29 +0000 (13:18 +0200)]
Improve X509_PKEY management in OpenSSL

Remove the free_pkey argument from php_openssl_pkey_from_zval,
instead return an EVP_PKEY that always needs to be freed
(by incrementing refcount if necessary).

This makes the code simpler and fixes a number of bugs in the
existing handling.

Closes GH-5946.

4 years agoExpand upgrading note for namespaced name change
Nikita Popov [Mon, 10 Aug 2020 09:19:35 +0000 (11:19 +0200)]
Expand upgrading note for namespaced name change

Mention the case from bug #79942.

[ci skip]

4 years agoFixed bug #79948
Nikita Popov [Mon, 10 Aug 2020 08:28:13 +0000 (10:28 +0200)]
Fixed bug #79948

Make sure we don't execute further scripts if one of them encountered
an exit exception.

Also make sure that we free file handles that end up unused due to
an early abort in php_execute_scripts(), which turned up as an
issue in the added test case.

Finally, make use of EG(exit_status) in the places where we
zend_eval_string_ex, instead of unconditionally assigning exit
code 254. If an error occurs, the error handler will already set
exit status 255.

4 years agoFixup phar test
Nikita Popov [Mon, 10 Aug 2020 08:47:18 +0000 (10:47 +0200)]
Fixup phar test

4 years agoFixed bug #77561
Nikita Popov [Mon, 10 Aug 2020 08:38:33 +0000 (10:38 +0200)]
Fixed bug #77561

Unconditionally strip shebang lines when using the CLI SAPI,
independently of whether they occur in the primary or non-primary
script. It's unlikely that someone intentionally wants to print
that shebang line when including a script, and this regularly
causes issues when scripts are used in multiple contexts, e.g.
for direct invocation and as a phar bootstrap.

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

* PHP-7.4:
  Fixed bug #79947

4 years agoFixed bug #79947
Nikita Popov [Mon, 10 Aug 2020 08:08:31 +0000 (10:08 +0200)]
Fixed bug #79947

Move the FREE_OP for op_data out of the zend_binary_assign_op_dim_slow()
slow path, so it can be used by the other error path as well. This
makes ASSIGN_DIM_OP structurally more similar to ASSIGN_DIM.

4 years agoFixed bug #79946
Nikita Popov [Mon, 10 Aug 2020 07:50:55 +0000 (09:50 +0200)]
Fixed bug #79946

Declare __STDC_CONSTANT_MACROS and __STDC_FORMAT_MACROS via -D
to make sure they are declared before the first stdint.h include.
We also define these in php_stdint.h, but don't always include that
file first.

This is necessary for old compilers that use C99 rather than C11
semantics for stdint.h.

4 years agoproc_open/openpty: DragonFlyBSD build fix.
David Carlier [Sat, 8 Aug 2020 16:30:15 +0000 (17:30 +0100)]
proc_open/openpty: DragonFlyBSD build fix.

Similarly to NetBSD emalloc-ish api had been introduced into libutil.

Closes GH-5960.

4 years agoRevert "Make diff section contents red(-)/green(+) in run-tests.php"
Nikita Popov [Mon, 10 Aug 2020 07:38:48 +0000 (09:38 +0200)]
Revert "Make diff section contents red(-)/green(+) in run-tests.php"

This reverts commit 58489bd3b93e10c150933eefac05297b48213eb3.

This also uses ANSI escape code coloring for .diff files, where it
is not meaningful.

4 years agoMake diff section contents red(-)/green(+) in run-tests.php
Tyson Andre [Sun, 9 Aug 2020 15:58:08 +0000 (11:58 -0400)]
Make diff section contents red(-)/green(+) in run-tests.php

This uses green for lines with `+` and red for lines with `-`.

Colors(Red and Green) would make the failure causes stand out visually when scrolling through errors.

Closes GH-5965

4 years agoUse short array values in run-tests.php
Tyson Andre [Sun, 9 Aug 2020 19:45:04 +0000 (15:45 -0400)]
Use short array values in run-tests.php

The run-tests.php file already requires php 7 syntax.
Done automatically with phpcbf with no other changes done/planned.

This file is already using short arrays in other places.

run-tests has already been substantially refactored in PHP 8.0
compared to PHP 7.4.

This makes merge conflicts more likely, but changes to run-tests.php on older
versions are less frequent bug fixes.

4 years agoAdd many missing closing PHP tags to tests
Máté Kocsis [Sun, 9 Aug 2020 09:06:57 +0000 (11:06 +0200)]
Add many missing closing PHP tags to tests

Closes GH-5958

4 years agoFix m4 quotation
Nikita Popov [Sat, 8 Aug 2020 08:38:31 +0000 (10:38 +0200)]
Fix m4 quotation

We should not try to expand AX_CHECK_COMPILE_FLAG inside the
error message...

4 years agoPromote various warnings to Error in GMP extension
George Peter Banyard [Fri, 7 Aug 2020 16:15:25 +0000 (18:15 +0200)]
Promote various warnings to Error in GMP extension

This gets rid of most false returns

Closes GH-5882

4 years agoAdd colours to test results in run-tests.php
George Peter Banyard [Fri, 31 Jul 2020 18:02:59 +0000 (19:02 +0100)]
Add colours to test results in run-tests.php

The test runner will attempt to colourise the result of each test

The --no-color option is introduced to disable this feature.

Closes GH-5901

4 years agoDrop '#if 0' in mysqlnd_debug() from the MySQLnd extension
George Peter Banyard [Thu, 6 Aug 2020 15:27:13 +0000 (17:27 +0200)]
Drop '#if 0' in mysqlnd_debug() from the MySQLnd extension

Closes GH-5587

4 years agoRemove some duplicate iconv path logic
Nikita Popov [Fri, 7 Aug 2020 15:20:02 +0000 (17:20 +0200)]
Remove some duplicate iconv path logic

PHP_SETUP_ICONV already adds the include path to INCLUDES and the
library path to SHARED_LIBADD.

4 years agoRemove PHP_ICONV_H_PATH
Nikita Popov [Fri, 7 Aug 2020 14:11:27 +0000 (16:11 +0200)]
Remove PHP_ICONV_H_PATH

Directly include <iconv.h> instead, now that the giconv.h
distinction no longer exists.

4 years agoRemove giconv support
Nikita Popov [Fri, 7 Aug 2020 14:05:24 +0000 (16:05 +0200)]
Remove giconv support

The best information I was able to find about this is this mail
from 2009 which indicates that giconv is an old FreeBSD iconv
implementation that has long since been superseded by libiconv.

https://lists.samba.org/archive/samba-technical/2009-June/065177.html

4 years agoRemove more leftovers of PHP_DEFINE handling
Nikita Popov [Fri, 7 Aug 2020 13:54:01 +0000 (15:54 +0200)]
Remove more leftovers of PHP_DEFINE handling