Commit graph

1678 commits

Author SHA1 Message Date
Nikita Popov
36db71df47 Merge branch 'PHP-7.4' 2019-07-22 12:28:40 +02:00
Nikita Popov
964de035a7 Deprecate restore_include_path() 2019-07-22 11:39:52 +02:00
Nikita Popov
b3668aabf7 Deprecate convert_cyr_string() 2019-07-22 11:39:52 +02:00
Nikita Popov
4e190691e2 Deprecate is_real() function 2019-07-22 11:39:52 +02:00
Nikita Popov
b1cdf06673 Deprecate money_format() 2019-07-22 11:39:52 +02:00
Nikita Popov
4e4d8a4a6c Deprecate hebrevc() 2019-07-22 11:39:52 +02:00
Nikita Popov
e9e2fa4ad4 Deprecate ezmlm_hash() 2019-07-22 11:39:52 +02:00
Nikita Popov
b2ea507bea Deprecate get_magic_quotes_gpc() and get_magic_quotes_runtime() 2019-07-22 11:39:52 +02:00
Nikita Popov
3faa903d47 Merge branch 'PHP-7.4' 2019-07-16 16:44:46 +02:00
Nikita Popov
49bac9b77b Introduce zend_stream_init_filename()
Avoid more ad-hoc initialization of zend_file_handle structures.
2019-07-16 16:44:37 +02:00
Peter Kokot
7f994990ea Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_STRCOLL check
2019-06-28 00:13:25 +02:00
Peter Kokot
638c21765c Remove HAVE_STRCOLL check
The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~nsz/c/c89/c89-draft.html#4.11.4.3

- Remove also SKIPIF strcoll check in test
2019-06-28 00:05:55 +02:00
Joe Watkins
3d759e11a0
Merge branch 'PHP-7.4'
* PHP-7.4:
  Use uint64_t for time_sleep_until calculations
2019-06-16 19:20:37 +02:00
Nikita Popov
4befe320e3
Use uint64_t for time_sleep_until calculations 2019-06-16 19:20:08 +02:00
Nikita Popov
d3ed9d8192 Make sure array_splice() always returns an array
Return an array even if the return value isn't used. This allows us
to add the arginfo return type.
2019-06-05 14:56:32 +02:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Gabriel Caruso
192170a39a Add return type to some array_* functions 2019-06-05 00:13:52 -03:00
Gabriel Caruso
7393777da9 Add return type for string functions 2019-06-01 11:52:06 -03:00
Gabriel Caruso
f3f159a779 Add double return type for math functions 2019-06-01 11:52:06 -03:00
Gabriel Caruso
edd7fb2a16 Add boolean return type for is_* functions 2019-05-30 13:55:36 -03:00
Nikita Popov
d95c15e371 Update MAY_BE_NULL for parts of ext/standard
Also update proto comments to be more accurate.
2019-05-28 12:11:32 +02:00
Nikita Popov
0b66563eee Merge branch 'PHP-7.4' 2019-05-28 11:15:37 +02:00
Dik Takken
77cf3d7b11 Allow array_merge() / array_merge_recursive() without arguments
This allows writing

    array_merge(...$arrays)

instead of

    array_merge([], ...$arrays)

and is in line with similar changes to array_push() and array_unshift()
in PHP 7.3.

Closes GH-4175.
2019-05-28 11:14:15 +02:00
Nikita Popov
521a919caf Add return type information to some ext/standard functions
Just the first few functions in basic_functions.c to get started.

If anyone is interested in continuing this, PRs to add type info
will be accepted against master, with the following caveats:

 * Return types only, we are not ready to add argument types yet.
 * Only for functions. For methods the addition of return types is
   BC breaking and needs to be carefully considered.
 * Only in cases where we can actually express the return type, we
   don't have int|false and similar.
2019-05-28 11:01:10 +02:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Dmitry Stogov
2e4686b566 Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:16:47 +03:00
Dmitry Stogov
34db07567d Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal functions. 2019-04-24 16:14:48 +03:00
Nikita Popov
2f97bb6cfc Add test for get_cfg_var with array variable
And fix incorrect variable shadowing in add_config_entry(). However,
the test doesn't hit this case, as it requires a nested array. I'm
not sure if it's possible to produce nested arrays from ini?
2019-04-12 15:12:45 +02:00
Nikita Popov
733c61a894 Add test for get_cfg_var with array variable
And fix incorrect variable shadowing in add_config_entry(). However,
the test doesn't hit this case, as it requires a nested array. I'm
not sure if it's possible to produce nested arrays from ini?
2019-04-12 15:12:39 +02:00
Peter Kokot
e6f86fb17c Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove checks for locale.h, setlocale, localeconv
2019-04-07 18:34:02 +02:00
Peter Kokot
e06836a1a3 Remove checks for locale.h, setlocale, localeconv
The `<loccale.h>` header file, setlocale, and localeconv are part of the
standard C89 [1] and on current systems can be used unconditionally.

Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`,
`HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in
configure.ac [2] can be ommitted and simplifed.

The bundled libmagic (file) has also been patched already in version
5.35 and up in upstream location so when it will be patched also in
php-src the check for locale.h header is still left in the configure.ac
and in windows headers definition file.

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4

Omit the bundled libmagic files
2019-04-07 18:32:54 +02:00
Joe Watkins
abd0e015a8
Merge branch 'PHP-7.4'
* PHP-7.4:
  tsrm environment lock
2019-03-29 19:06:59 +01:00
Joe Watkins
072eb6dd77
tsrm environment lock 2019-03-29 19:06:02 +01:00
Nikita Popov
bbdc5d1da6 Merge branch 'PHP-7.4' 2019-03-11 10:01:16 +01:00
c9s
9f6f6fe219 Remove function_table var from the caller
function_table var is not used in call_user_function macro anymore
hence replace the usage with NULL
2019-03-11 10:00:39 +01:00
Peter Kokot
20addf88e4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unused PHP_AC_BROKEN_SPRINTF and AC_ZEND_BROKEN_SPRINTF
2019-02-23 22:29:16 +01:00
Peter Kokot
b33fa18eab Remove unused PHP_AC_BROKEN_SPRINTF and AC_ZEND_BROKEN_SPRINTF
The sprintf function has been normalized to php_sprintf via
61364b5bb1.

This patch removes the checks to make a custom sprintf function

The ZEND_BROKEN_SPRINTF has been removed and the
hardcoded #define zend_sprintf sprintf is used.

The php_sprintf and zend_sprintf are now symbols to sprintf.

This patch now removes the custom PHP definitions of the php_sprintf and
zend_sprintf functions in favor of the C99 sprintf which is also
standardized in C89 already. Once, on some systems sprintf didn't behave
in same way.
2019-02-23 22:26:47 +01:00
Nikita Popov
879cd04913 Merge branch 'PHP-7.4' 2019-02-18 17:51:41 +01:00
Tyson Andre
9249d82019 Fix typos in code comments [skip ci] 2019-02-18 17:48:12 +01:00
Anatol Belski
08aaff35d1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Implement FR #77377 handle CTRL+C in Windows
2019-02-08 18:11:34 -08:00
Anatol Belski
12bfd9a5f5 Implement FR #77377 handle CTRL+C in Windows 2019-02-08 18:10:31 -08:00
Peter Kokot
623911f993 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove local variables
2019-02-03 21:23:18 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Zeev Suraski
38c337f22e Remove year range from copyright notice 2019-01-30 11:00:23 +02:00
Nikita Popov
c7d7af8069 Remove fgetss and friends
These were deprecated in PHP 7.3 as part of
https://wiki.php.net/rfc/deprecations_php_7_3.
2019-01-29 09:43:00 +01:00
Nikita Popov
ff780feca4 Require second argument on (mb_)parse_str()
This was deprecated in PHP 7.2 as part of
https://wiki.php.net/rfc/deprecations_php_7_2.
2019-01-28 15:58:24 +01:00
Dmitry Stogov
ab9a9a6b20 Disallow PHP startup, in case some ext ext/standard sub-module is not initialized sucessfully. 2019-01-24 15:59:33 +03:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00