Commit Graph

1431 Commits

Author SHA1 Message Date
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
Dmitry Stogov
cec091176c Replace zend_hash_apply... with ZEND_HASH_FOREACH... 2018-12-19 02:49:56 +03:00
Dmitry Stogov
d206630f13 Fixed memory leaks 2018-12-13 16:21:08 +03:00
Gabriel Caruso
cdd8368d6f Clean up unnecessary ternary expressions and simplify some returns
- Simplify conditions
- Use ZEND_HASH_APPLY_* instead of hard-coded booleans
- Use ZEND_NORMALIZE_BOOL
- Drop sign in favor of ZEND_NORMALIZE_BOOL
2018-12-03 01:22:14 +01:00
Sara Golemon
534df87c9e
Implement password mechanism registry
RFC: https://wiki.php.net/rfc/password_registry
2018-11-20 17:26:55 -05:00
Zeev Suraski
67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Peter Kokot
d3ca28f569 Remove HAVE_STRING_H
The C89 standard and later defines the `<string.h>` header as part of
the standard headers [1] and on current systems it is always present.

Code included also `<strings.h>` header as an alterinative in some
files. This kind of check was relevant on some older systems where the
`<strings.h>` file included definitions for the C89 compliant
`<string.h>`. Today such alternative check is not required anymore. The
`<strings.h>` file is part of the POSIX definition these days.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

This patch also cleans few unused `<strings.h>` inclusions in the libmbfl.

[1]: https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2]: http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-18 05:32:08 +02:00
Christoph M. Becker
6da3a1e3ce Revert "Implement #67331: Have parse_ini_file add empty entries"
This reverts commit 3f3e914df3.

The commit broke some tests on Windows, and generally needs more
though.
2018-09-15 17:08:58 +02:00
Christoph M. Becker
3f3e914df3 Implement #67331: Have parse_ini_file add empty entries
Some INI processors allow to specify empty values by just giving the
key without the equals sign, for instance MySQL and Python.  It appears
to be sensible to add this possibility to our INI parser, so that it
can be used for such INI files as well.  We choose NULL as the value of
empty values.

This syntactical enhancement is a (minor) BC break, though, as can be
seen by the necessary change to bug49692.ini.  The “comment” formerly
has been simply ignored, but now it would be parsed as key with an
empty value.

This PR is based on Adam's former patch.
2018-09-15 15:37:01 +02:00
Pedro Magalhães
2b58ab23c6 Support for samesite cookies with array syntax
Allows using an alternative array argument with
support for the samesite option on the following
functions:
setcookie
setrawcookie
session_set_cookie_params
2018-07-31 12:40:26 +02:00
Frederik Bosch
08b9310e6d implement same site cookie see https://bugs.php.net/bug.php?id=72230 see https://tools.ietf.org/html/draft-west-first-party-cookies-07 see https://scotthelme.co.uk/csrf-is-dead/ 2018-07-31 12:40:24 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Nikita Popov
d9acfa45b8 Deprecate fgetss() and gzgetss()
SplFileObject::fgetss() will also generate a deprecation notice
through an internal call to fgetss().

Part of RFC https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:38:35 +02:00
Enno Woortmann
50516a6e1f Add implementation and tests for new methods - array_key_first(array $a) Returns the key of the first element or null - array_key_last(array $a) Returns the key of the last element or null 2018-07-17 11:31:00 +02:00
Dmitry Stogov
83f6f8563c Use zval_ptr_dtor() instead of legacy zval_dtor(), to destroy unused values returned from PHP functions (they may be circular data structures). 2018-07-05 14:09:47 +03:00
Dmitry Stogov
b6fb584505 Replace zval_dtor() with specialized destructors 2018-07-05 13:32:39 +03:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Dmitry Stogov
0b90cf85a6 Removed "dead" code (zend_hash_update() never fails) 2018-06-01 11:58:57 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Dmitry Stogov
524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Christoph M. Becker
9993304da4 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix arginfo for array_replace(_recursive) and array_merge(_recursive)
2018-04-13 15:36:15 +02:00
Christoph M. Becker
3770c2e463 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix arginfo for array_replace(_recursive) and array_merge(_recursive)
2018-04-13 15:28:47 +02:00
Gabriel Caruso
bb79e5764b Fix arginfo for array_replace(_recursive) and array_merge(_recursive) 2018-04-13 15:27:16 +02:00
Chris Wright
658a23a974 Remove warnings from inet_pton()/inet_ntop() 2018-04-03 14:51:47 +01:00
timurib
f7f48643e7 Remove redundant warning in array_push() and array_unshift()
Cf. https://github.com/php/php-src/pull/3011.
2018-03-25 17:49:04 +02:00
Gabriel Caruso
d0ee2a8254 Add is_countable function
RFC: https://wiki.php.net/rfc/is-countable
2018-03-11 16:41:16 +01:00
Anatol Belski
0d679c353c Get rid of casts 2018-03-01 20:52:09 +01:00
Christoph M. Becker
d5f84fb9c5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix some arginfos
2018-02-23 11:32:18 +01:00
Christoph M. Becker
c6cf3d4ada Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix some arginfos
2018-02-23 11:29:21 +01:00
Gabriel Caruso
0b8cfa6c78 Fix some arginfos
* all arguments for ftp_pasv are required
* $varname for getenv function isn't required anymore
* fsockopen and pfsockopen only require $hostname
* strtok can work with only one parameter
* strpbrk needs two parameters to work
* required parameters and add some parameters in openssl_* functions
2018-02-23 11:27:14 +01:00
Gabriel Caruso
1314f0fb3a Use int instead of long in protos 2018-02-23 11:06:20 +01:00
Joe
13a9a886fa
Revert "Added return type for some basic functions"
This reverts commit b7d2e04f1f.
2018-02-14 11:18:52 +01:00
Dmitry Patsura
b7d2e04f1f
Added return type for some basic functions 2018-02-14 09:18:52 +01:00
Xinchen Hui
cf0fae5e97 Optimized base64_encode/decode with SIMD instructions 2018-02-12 20:53:14 +08:00
Anatol Belski
a6e86f7a3f Implement intrinsic function resolving per MINIT 2018-01-24 09:33:32 +01:00
Dmitry Stogov
48b4e01680 Eliminate useless separations 2018-01-17 14:11:40 +03:00
Anatol Belski
83497327e7 Implement high resolution monotonic timer function hrtime() 2018-01-07 16:03:52 +01:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Anatol Belski
f3f6cd24e9 Modernize realpath and integrate quick variant into virtual_file_ex
The slower I/O as a traditional bottleneck on Windows which is
the target of this patch. The recursive path resolution, while being
an allround solution, is expensive when it comes to the common case.
Files with proper ACLs set can be resolved in one go by usage of specific
API. Those are available since Vista, so actually can be called old. Those
simpler api is used for the cases where no CWD_EXPAND is requested. For
the cases where ACLs are improper, the existing solution based on
FindFirstFile still does good job also partially providing quirks. Cases
involing reparse tags and other non local filesystems are also partially
server by new APIs.

The approach uses both APIs - the quick one for the common case still
integrating realpath cache, and the existing one as a fallback. The tests
show the I/O load drop on the realpath resolution part due to less
system calls for the sub part resolution of paths. In most case it is
justified, as the sub parts were otherwise cached or unused as well. The
realpath() implementation in ioutil is also closer to the POSIX.
2017-12-15 13:23:34 +01:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
dc47171523 Avoid temporary string creation and destruction. 2017-12-11 18:18:30 +03:00
Dmitry Stogov
cc12acefcd Use cheaper functions 2017-12-04 13:21:35 +03:00
Dmitry Stogov
7cc6f60134 Added "argv" and "argc" as known strings.
Fixed incorrect "argc" update and corresponding phpdbg test.
2017-12-01 01:35:47 +03:00
Anatol Belski
89da3ed4d7 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix allocation
  Fix memory leak
2017-11-27 21:19:17 +01:00