Commit Graph

120113 Commits

Author SHA1 Message Date
Nikita Popov
b03e300a29 Fix test after PDOStatement::fetchObject() change 2020-08-13 16:45:32 +02:00
Nikita Popov
396b47061f Use zpp C in pg_fetch_object 2020-08-13 16:24:08 +02:00
Nikita Popov
670036e2a9 Use Z_PARAM_CLASS in PDOStatement::fetchObject()
Instead of implementing custom logic.
2020-08-13 16:20:29 +02:00
Nikita Popov
1511bdae96 Throw Error on uninitialized XMLWriter 2020-08-13 16:13:02 +02:00
Nikita Popov
fc7bab3aee Throw on uninitialized SimpleXMLElement
Elevate this warning into an Error, as usual. Add a few checks
in places that were missing them.
2020-08-13 16:13:02 +02:00
Nikita Popov
f5e6f9bd27 Avoid fatal error on not found class in mysqli_fetch_object()
Instead use C zpp modifier and throw TypeError.
2020-08-13 16:13:02 +02:00
Máté Kocsis
a10f8876ef
Check missing parameter types in stubs
[skip ci] Closes GH-5627
2020-08-13 15:17:31 +02:00
Máté Kocsis
cb2f689778
Fix param name in PHPDoc 2020-08-13 14:54:48 +02:00
Máté Kocsis
2803c8fb8d
Add all the missing parameter types to stubs
Closes GH-5955
2020-08-13 14:47:18 +02:00
Nikita Popov
f3d6203b0b Use a dedicated method for MultipleIterator::countIterators()
This method has a different signature from
SplObjectStorage::count(), so don't share implementations.
2020-08-13 14:44:03 +02:00
Nikita Popov
f0bf3d4672 Replace fatal error in SplFileInfo with exception
Using RuntimeException here, because the same error condition
uses that in many other places in this file.
2020-08-13 14:43:45 +02:00
Nikita Popov
634dd38289 Throw Error exception in DOM_GET_OBJ
Per general convention for handling of uninitialized objects.
2020-08-13 14:43:40 +02:00
Nikita Popov
e17ff61962 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:
47b62ac45e/index.js (L154)

Closes GH-5764.
2020-08-13 12:37:33 +02:00
Nikita Popov
cdc4e49b84 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.
2020-08-13 12:02:27 +02:00
Remi Collet
f16c1dc7ee fix test expectation 2020-08-13 09:36:42 +02:00
George Peter Banyard
90330a4460 Drop redundant arg count check 2020-08-13 02:37:00 +02:00
Tyson Andre
45d69fb809 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.
2020-08-12 09:37:45 -04:00
Nikita Popov
b480e6841e Recognize gnu-libiconv location on alpine 2020-08-12 15:32:11 +02:00
David Carlier
6ca6e9f891 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.
2020-08-12 15:09:21 +02:00
Nyholm
3485ec40ce Small CS fix
The comments were incorrectly aligned. Fix this by dropping the
alignment and moving the comments before the declarations.

Closes GH-5975.
2020-08-12 12:16:53 +02:00
Nikita Popov
824541d57e 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.
2020-08-12 10:36:40 +02:00
Tyson Andre
1e9a5c67ef 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.
2020-08-11 19:11:59 -04:00
Ilija Tovilo
10f660f0a5
Fix ?-> in encaps vars without braces
Closes GH-5966.
2020-08-11 21:16:44 +02:00
Nikita Popov
898bb97706 Drop php_pdo_get_exception_base() function
This API is more confusing than helpful.
2020-08-11 17:40:39 +02:00
Nikita Popov
33028bf014 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
2020-08-11 17:16:38 +02:00
Nikita Popov
981af26d7b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
2020-08-11 17:13:28 +02:00
Ahmed Abdou
2fe2e5b48f 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.
2020-08-11 17:12:48 +02:00
Nikita Popov
8694eb14f4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #75785 by attempt switching endianness on Maker's Note
2020-08-11 16:29:01 +02:00
Nikita Popov
5c5508698d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #75785 by attempt switching endianness on Maker's Note
2020-08-11 16:27:06 +02:00
Nawarian
2fa4ca95db 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.
2020-08-11 16:26:34 +02:00
Nikita Popov
e25aab6426 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.
2020-08-11 15:48:40 +02:00
Nikita Popov
227f1f1481 Fix nullsafe operator on $this 2020-08-11 15:22:14 +02:00
Nikita Popov
42eda5160d SAVE_OPLINE in NULL_HANDLER
Let's avoid crashing before the nice error message gets printed...
2020-08-11 15:14:50 +02:00
Nikita Popov
f491dabe40 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.
2020-08-11 15:11:36 +02:00
Nikita Popov
75baa729f5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79917
2020-08-11 14:59:04 +02:00
Nikita Popov
4609ded082 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.
2020-08-11 14:58:54 +02:00
Christoph M. Becker
9e930907df Autogenerate function entries for COMPersistHelper
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2020-08-11 11:42:40 +02:00
Christoph M. Becker
dc5077cc53 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.
2020-08-11 11:38:43 +02:00
Christoph M. Becker
013dcab344 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #48585: com_load_typelib holds reference, fails on second call
2020-08-11 11:28:41 +02:00
Christoph M. Becker
183b853dc6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #48585: com_load_typelib holds reference, fails on second call
2020-08-11 11:28:07 +02:00
Christoph M. Becker
dc108feab8 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.
2020-08-11 11:26:50 +02:00
Nikita Popov
dd858460bb Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79951
2020-08-11 10:35:59 +02:00
Nikita Popov
66d9f4d985 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79951
2020-08-11 10:35:25 +02:00
Nikita Popov
9d9dffe60a Fixed bug #79951
One branch did not release tmp_replace_entry_str.

Also reduce the scope of some variables.
2020-08-11 10:33:59 +02:00
Máté Kocsis
56135654a0
Remove unnecessary function entry array 2020-08-11 09:41:54 +02:00
George Wang
e05439e7a4 Merge branch 'PHP-7.4' 2020-08-10 19:11:48 -04:00
George Wang
1b0a2bb0f5 Merge branch 'PHP-7.3' into PHP-7.4 2020-08-10 19:11:26 -04:00
George Wang
07cb2755be Make sure string is NUL byte terminated. 2020-08-10 19:11:03 -04:00
Christoph M. Becker
2538e31b58 Fix signature of callback function
Cf. <https://docs.microsoft.com/en-us/windows/win32/api/imagehlp/nc-imagehlp-pimagehlp_status_routine>.
2020-08-10 23:26:54 +02:00
Nikita Popov
7e87173497 Merge branch 'PHP-7.4'
* PHP-7.4:
  Check the correct list
2020-08-10 21:53:26 +02:00