Commit Graph

2348 Commits

Author SHA1 Message Date
Nikita Popov
187f359549 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix leak in DateTimeImmutable::modify()
2020-01-30 12:17:10 +01:00
Nikita Popov
494615fcb8 Fix leak in DateTimeImmutable::modify() 2020-01-30 12:16:56 +01:00
Nikita Popov
472fc3a2a9 Fix leak in DatePeriod construction with invalid format
Same issue as I fixed in DateInterval construction before.
2020-01-30 11:13:04 +01:00
Nikita Popov
648f16c2ec Fix rel_date leak on DateInterval construction failure 2020-01-28 13:11:49 +01:00
Máté Kocsis
99db00b1f2
Fix #78880 Another round 2020-01-19 18:28:43 +01: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
Máté Kocsis
afdaa91170
Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
mike
1658b5babc Adding DateTime(Immutable)::createFromInterface()
These are like

    DateTime::createFromImmutable()
    DateTimeImmutable::createFromMutable()

but accept any DateTimeInterface instead.

Closes GH-5016.
2020-01-03 16:55:12 +01:00
Christoph M. Becker
1400f4ac12 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79015: undefined-behavior in php_date.c
2020-01-03 14:32:56 +01:00
Christoph M. Becker
40b2f82380 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79015: undefined-behavior in php_date.c
2020-01-03 14:32:30 +01:00
Christoph M. Becker
b48f2625b5 Fix #79015: undefined-behavior in php_date.c
We check that the given microsecond fraction is in the valid range
[0, 1000000[, and otherwise mark it as invalid.  We also drop the
useless do loop; a plain block is sufficient here.
2020-01-03 14:31:03 +01:00
Máté Kocsis
1b93cfee0c
Use RETURN_THROWS() after zend_parse_method_parameters() 2020-01-02 23:01:37 +01:00
Máté Kocsis
349a286461
Use RETURN_THROWS() after zend_throw_error() 2020-01-01 16:42:30 +01:00
Máté Kocsis
2f7309b1e9
Use RETURN_THROWS() during ZPP in the date, dba and dom extensions 2019-12-31 00:21:37 +01:00
Christoph M. Becker
dabc28d182 Fix #78880: Spelling error report
We fix the most often occuring typos according to a recent codespell
report[1] in tests, code comments and documentation.

[1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
2019-12-21 11:58:00 +01:00
Nikita Popov
69eaddabf8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove DateTime class registration test
2019-12-16 18:57:47 +01:00
Nikita Popov
8e12f04b5e Remove DateTime class registration test
This test is more annoying than useful.
2019-12-16 18:57:19 +01:00
Nikita Popov
0cec268d15 Support single class unions in gen stubs 2019-11-15 17:19:26 +01:00
Nikita Popov
468ecf295d Fix DateTimeImmutable stubs
These were referencing the arginfo from the functions, instead of
the methods, which isn't right, as the functions have return types.
2019-11-15 16:02:26 +01:00
Máté Kocsis
27e83d0fb8
Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Máté Kocsis
2204dbde3b Add missing ZPP checks
Closes GH-4878.
2019-11-01 15:26:52 +01:00
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Nikita Popov
6719d3e718 Add Z_PARAM_STRING/ARRAY_OR_NULL convenience macros 2019-10-29 13:29:52 +01:00
Christoph M. Becker
f9a98f6dbd Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78751: Serialising DatePeriod converts DateTimeImmutable
2019-10-28 13:09:44 +01:00
Christoph M. Becker
9e4c5db733 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78751: Serialising DatePeriod converts DateTimeImmutable
2019-10-28 13:09:24 +01:00
Christoph M. Becker
736cd93ef5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78751: Serialising DatePeriod converts DateTimeImmutable
2019-10-28 13:08:34 +01:00
Christoph M. Becker
89c327f884 Fix #78751: Serialising DatePeriod converts DateTimeImmutable
When getting the properties of a DatePeriod instance we have to retain
the proper classes, and when restoring a DatePeriod instance we have to
cater to DateTimeImmutable instances as well.
2019-10-28 13:07:28 +01:00
Christoph M. Becker
43a1363a05 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test case
2019-10-18 16:24:14 +02:00
Christoph M. Becker
81806db90b Fix test case
Cf. <https://github.com/php/php-src/pull/4687>.
2019-10-18 16:23:56 +02:00
Christoph M. Becker
2484f1e88a Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #70153 \DateInterval incorrectly unserialized
2019-10-18 15:33:58 +02:00
Christoph M. Becker
197568d634 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #70153 \DateInterval incorrectly unserialized
2019-10-18 15:33:25 +02:00
Christoph M. Becker
c7c7ab53ac Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #70153 \DateInterval incorrectly unserialized
2019-10-18 15:32:08 +02:00
m.yakunin
d2cde0bfd3 Fix #70153 \DateInterval incorrectly unserialized
Added a separate macro for reading 'days' property, so that bool(false)
is correctly converted to the proper internal representation.
2019-10-18 15:31:14 +02:00
Derick Rethans
087d8cd214 Merge branch 'PHP-7.4' 2019-10-15 21:01:05 +01:00
Derick Rethans
3f7cc8361c Merge branch 'PHP-7.3' into PHP-7.4 2019-10-15 21:00:57 +01:00
Derick Rethans
3725a446ba Import timelib version 2018.03 2019-10-15 21:00:39 +01:00
Dmitry Stogov
b02b81299c Comparison cleanup:
- introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval)
- remove compare_objects() object handler, and keep only compare() handler
2019-10-07 17:57:49 +03:00
Nikita Popov
5f80eb7842 Fix required number of arguments in stubs
* get_parent_class() argument is optional
* Mark array_filter() $callback as optional
* The $base of gmp_strval() is optional
* DateTime constructor also accepts zero arguments
* hash_update_file() stream context is optional
* xmlwriter_write_dtd_entity() $isparam argument is optional
2019-10-07 16:33:41 +02:00
Nikita Popov
647b1c7fcf Remove most uses of ZEND_PARSE_PARAMETERS_END_EX()
As ZPP now throws, it makes no sense to specify an explicit return
value.
2019-10-07 10:02:18 +02:00
Derick Rethans
a0eef7067b Updated to version 2019.3 (2019c) 2019-10-02 23:39:12 +01:00
Derick Rethans
a46bdcb631 Updated to version 2019.3 (2019c) 2019-10-02 23:39:11 +01:00
Derick Rethans
0505fbf2e5 Updated to version 2019.3 (2019c) 2019-10-02 23:39:09 +01:00
Nikita Popov
2f92957fd3 Convert some notices to warnings
Part of https://wiki.php.net/rfc/engine_warnings.
2019-10-02 10:34:08 +02:00
Nikita Popov
235983dfde Merge branch 'PHP-7.4' 2019-09-30 17:52:39 +02:00
Fabien Villepinte
0aa3acc6c4 Fix borked SKIPIFs 2019-09-30 17:51:41 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
962a9cd74e Merge branch 'PHP-7.4' 2019-09-19 11:36:29 +02:00
Nikita Popov
22516b7d8a Merge branch 'PHP-7.3' into PHP-7.4 2019-09-19 11:36:19 +02:00
Nikita Popov
f53b8268d6 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-19 11:36:09 +02:00
CJDennis
e3255a4f49 Fix typo
`sizeof("data")-1` and `sizeof("date")-1` are both 4, so no change in behaviour
2019-09-19 11:36:00 +02:00
Craig Duncan
06aa2ae993 Update the date class arginfo the new format 2019-08-12 20:57:30 +01:00
Kyle
b17957eaac Add missing parameters to __set_state() methods
Closes GH-4526.
2019-08-12 15:20:23 +02:00
Derick Rethans
0835e66372 Updated to version 2019.2 (2019b) 2019-08-11 16:06:00 +01:00
Derick Rethans
f465560a0f Updated to version 2019.2 (2019b) 2019-08-11 16:05:59 +01:00
Derick Rethans
7aa1dd3ba1 Updated to version 2019.2 (2019b) 2019-08-11 16:05:58 +01:00
Nikita Popov
3b2f2ce474 Make uninitialized DateTime an Error
This avoids many spurious false return values.
2019-08-09 14:51:25 +02:00
Nikita Popov
33886f710c Generate arginfo from PHP stub files
Signature stubs for internal functions are specified in xyz.stub.php,
from which we generate actual arginfo structures in xyz_arginfo.h.
This file then needs to be included in the implementation appropriately.

Arginfo from stubs can be regenerated using scripts/dev/gen_stub.php.
However, this should also automatically happen when the stub file is
modified.
2019-08-09 14:51:25 +02:00
Matteo Beccati
13980414eb Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test when default TZ is not UTC
2019-08-09 09:58:36 +02:00
Matteo Beccati
00dd786ba4 Fix test when default TZ is not UTC 2019-08-09 09:58:10 +02:00
Nikita Popov
527dad600b Merge branch 'PHP-7.4' 2019-08-08 09:56:10 +02:00
Nikita Popov
fc17bfaacf Fixed bug #78383 2019-08-08 09:55:52 +02:00
Christoph M. Becker
7556600dfc Fix #65547: Default value for sunrise/sunset zenith still wrong
The value of the zenith angle to calculate sunrise and sunset times is
commonly defined as 90°50', and is "obtained by adding the average
apparent radius of the Sun (16') to the average amount of atmospheric
refraction at the horizon (34')", according to
http://aa.usno.navy.mil/faq/docs/RST_defs.php.

This value is also used for the Sunrise/Sunset Algorithm published in
the Almanac for Computers, 1990, see
https://web.archive.org/web/20161202180207/http://williams.best.vwh.net/sunrise_sunset_algorithm.htm.
2019-07-15 13:52:09 +02:00
Peter Kokot
2ba4fb1263 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove timelib outdated defines
2019-07-14 13:50:43 +02:00
Peter Kokot
c72d6da461 Remove timelib outdated defines
- TIMELIB_OMIT_STDINT is not used anymore since
  a171f99cf0
- HAVE_GETTIMEOFDAY was defined multiple times in Windows headers
- ext/date/lib/timelib_config.h.win32 does not seem to be used

Closes GH-4400
2019-07-14 13:50:05 +02:00
Nikita Popov
bbd12b3d30 Merge branch 'PHP-7.4' 2019-07-10 11:11:30 +02:00
Nikita Popov
9d82a01d01 Clean up DateTimeZone::getLocation() test
And avoid invalid array access.
2019-07-10 11:09:41 +02:00
Derick Rethans
73734eee6c Merge branch 'PHP-7.4' 2019-06-30 15:51:04 +01:00
Derick Rethans
a60128c503 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-30 15:50:55 +01:00
Derick Rethans
cc3fe3bd30 Fixed tests due to changed timezone data 2019-06-30 15:50:38 +01:00
Derick Rethans
aae5907cb7 Update timelib to 2018.02 2019-06-30 15:45:13 +01:00
Peter Kokot
6bfa6bff0b Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean headers checks
2019-06-27 02:45:31 +02:00
Peter Kokot
2079b09854 Clean headers checks
Some headers were checked multiple times in the main configure.ac file
and in the bundled extensions or SAPIs themselves. Also many of these
checks are then used accross other extensions or SAPIs so a central
configure.ac makes most sense for these checks.
2019-06-27 02:45:09 +02:00
Joe Watkins
264536877d
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  export php_time
2019-06-19 12:40:23 +02:00
Joe Watkins
599b94ff14
export php_time 2019-06-19 12:39:51 +02:00
Joe Watkins
8cc26690b5
Merge branch 'PHP-7.4'
* PHP-7.4:
  Resolve discrepencies between second value yielded by gettimeofday and time, fixes #69044
2019-06-19 09:01:59 +02:00
Joe Watkins
fb95043acf
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Resolve discrepencies between second value yielded by gettimeofday and time, fixes #69044
2019-06-19 09:01:20 +02:00
Joe Watkins
025899e3b5
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Resolve discrepencies between second value yielded by gettimeofday and time, fixes #69044
2019-06-19 08:59:04 +02:00
Joe Watkins
65067dff01
Resolve discrepencies between second value yielded by gettimeofday and time, fixes #69044 2019-06-19 08:56:20 +02:00
Nikita Popov
4d90848d68 Don't verify arginfo types for internal functions
To avoid duplicate type checks. In debug builds arginfo is still
checked and will generate an assertions if the function doesn't
subsequently throw an exception.

Some test results change due to differences in zpp and arginfo
error messages.
2019-06-17 11:46:28 +02:00
Nikita Popov
d570620917 Merge branch 'PHP-7.4' 2019-06-11 16:21:57 +02:00
Nikita Popov
fc65da5c59 Fix 32-bit warnings in timelib
This has already been fixed upstream in
4df262e758
so I'm backporting this change.
2019-06-11 16:14:10 +02:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03: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
Craig Duncan
facfbf3c9c Update the DatePeriod read/write handlers 2019-05-30 19:16:31 +01:00
Craig Duncan
bc87424835 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add a test for bug #65672
  Ensure the internal properties cannot be overwritten
2019-05-30 19:15:58 +01:00
Craig Duncan
a08b3b6d19 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add a test for bug #65672
  Ensure the internal properties cannot be overwritten
2019-05-30 19:14:04 +01:00
Craig Duncan
370997fb5d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add a test for bug #65672
  Ensure the internal properties cannot be overwritten
2019-05-30 18:55:55 +01:00
Craig Duncan
8b53c7232e Add a test for bug #65672 2019-05-30 18:55:42 +01:00
Craig Duncan
dc586bff36 Ensure the internal properties cannot be overwritten 2019-05-30 18:55:36 +01:00
Nikita Popov
cf610347a7 Merge branch 'PHP-7.4' 2019-05-29 09:52:43 +02:00
Nikita Popov
3bd5b83615 Specify get_property_ptr_ptr handler for DatePeriod
This handler is required on 7.4. Just return NULL from it to fall
back to read_property.
2019-05-29 09:51:15 +02:00
Nikita Popov
5a0df6a414 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-29 09:47:54 +02:00
Nikita Popov
de7d0256a3 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-29 09:47:43 +02:00
Craig Duncan
5d67271db0 Add tests for DatePeriod properties 2019-05-29 09:47:10 +02:00
Dmitry Stogov
b2cdde0826 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
2019-05-28 20:19:15 +03:00
Dmitry Stogov
83804519df Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros 2019-05-28 20:10:02 +03:00
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
b60173af0b Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove duplicate variables
2019-05-12 03:06:19 +02:00
Vinicius Dias
188ece856d Remove duplicate variables
Removing duplicate variables `$beginDtObj` and `$beginTimestamp`.
2019-05-12 03:02:38 +02:00
Nikita Popov
fd2db11929 Always generate fatal error for LSP failures
RFC: https://wiki.php.net/rfc/lsp_errors
2019-05-07 13:45:28 +02:00
Nikita Popov
3a8304c35a Merge branch 'PHP-7.4' 2019-04-23 13:15:09 +02:00
Nikita Popov
3cfbbf2956 Make DateInterval objects uncomparable
Arbitrary DateInterval objects don't have well-defined comparison
semantics. Throw a warning and treat the objects as uncomparable.

Support for comparing DateInterval objects returned by
DateTime::diff() may be added in the future.
2019-04-23 13:12:06 +02:00
Peter Kokot
01cdae054b Merge branch 'PHP-7.4'
* PHP-7.4:
  Add test for date timestamp
2019-04-20 19:21:22 +02:00
Vitor Mattos
c050045faa Add test for date timestamp
- [date_timestamp_get] adding coverage for date_timestamp_get alias to
  DateTime::getTimestamp feature at PHPRio TestFest
- [date_timestamp_get] adding coverage for date_timestamp_get basic
  feature at PHPRio TestFest
- Combine tests into single file
2019-04-20 19:21:10 +02:00
Nikita Popov
648cc80987 Merge branch 'PHP-7.4' 2019-04-18 15:40:39 +02:00
Nikita Popov
3974180f92 Remove dead "props" member from date objects 2019-04-18 15:05:43 +02:00
Derick Rethans
b896819b99 Merge branch 'PHP-7.4' 2019-04-17 09:40:35 +01:00
Derick Rethans
4a3f64dfef Merge branch 'PHP-7.3' into PHP-7.4 2019-04-17 09:40:28 +01:00
Derick Rethans
6088713216 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-17 09:40:18 +01:00
Ignace Nyamagana Butera
7b1a4e2400 Fixed bug #77909: DatePeriod::__construct() with invalid recurrence count value
Improve error message on invalid reccurence count

Adding test when reccurence is -1
2019-04-17 09:39:03 +01:00
Gabriel Caruso
12446aafce Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_* for always available extensions
2019-04-14 11:51:39 -03:00
Gabriel Caruso
656db96eb9 Remove HAVE_* for always available extensions 2019-04-14 11:44:12 -03:00
Nikita Popov
890fe686bc Merge branch 'PHP-7.4' 2019-04-08 09:44:41 +02:00
Nikita Popov
c708c4b404 Avoid time(NULL) call if explicit timestamp given
As suggested by Benjamin Coutu.
2019-04-08 09:43:47 +02:00
Derick Rethans
83c9906bdb Updated to version 2019.1 (2019a) 2019-04-01 10:38:41 +01:00
Derick Rethans
9d620a94ac Updated to version 2019.1 (2019a) 2019-04-01 10:38:41 +01:00
Derick Rethans
a22bd7a3a8 Updated to version 2019.1 (2019a) 2019-04-01 10:38:40 +01:00
Nikita Popov
68d8880248 Merge branch 'PHP-7.4' 2019-03-18 10:14:19 +01:00
Nikita Popov
1b411c039f Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 10:14:03 +01:00
Nikita Popov
00cfa1a367 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 10:11:25 +01:00
Nikita Popov
a573c0e9ed Fix unused variable warning 2019-03-18 10:11:00 +01:00
Derick Rethans
d209ccd4cc Merge branch 'PHP-7.2' into PHP-7.3 2019-03-17 14:55:53 -04:00
Derick Rethans
ab07bc1fff Fixed 7.2 compat issue 2019-03-17 14:53:56 -04:00
Derick Rethans
ed2cbd49c8 Merge branch 'PHP-7.4' 2019-03-17 14:38:20 -04:00
Derick Rethans
0325e78f4f Merge branch 'PHP-7.3' into PHP-7.4 2019-03-17 14:38:11 -04:00
Derick Rethans
7e7ef44fab Merge branch 'PHP-7.2' into PHP-7.3 2019-03-17 14:38:04 -04:00
Ignace Nyamagana Butera
6eb83a63e1 Fixed bug #75113: Added DatePeriod::getRecurrences() method. 2019-03-17 14:37:35 -04:00
Peter Kokot
4b3da12363 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_STRFTIME
2019-03-14 19:43:45 +01:00
Peter Kokot
3a857852a8 Remove HAVE_STRFTIME
Function strftime is part of the C89 standard [1] and current systems
don't need to check for its presence anymore.

Additionally, checks for strftime function in tests have been removed
since the PHP strftime function is now always available.

1: https://port70.net/~nsz/c/c89/c89-draft.html
2019-03-14 19:42:29 +01:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Nikita Popov
513b76794b Make zpp failures always throw, independent of strict_types
Previously zend_parse_parameters (and FastZPP) would handle invalid
arguments depending on strict_types: With strict_types=1, a TypeError
is thrown, with strict_types=0 a warning is thrown and (usually) NULL
is returned. Additionally, some functions (constructors always and
other methods sometimes) opt-it to throwing regardless of strict_types.

This commit changes zpp to always generate a TypeError exception in
PHP 8.
2019-03-11 11:32:20 +01:00
Gabriel Caruso
726919e4b5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use EXPECT when possible
  Fix tests filenames
2019-03-11 00:07:32 -03:00
Gabriel Caruso
6c4e2079c0 Use EXPECT when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2019-03-11 00:05:44 -03:00
Nikita Popov
a32b89f029 Merge branch 'PHP-7.4' 2019-03-05 11:03:09 +01:00
Nikita Popov
94d509363d Remove more zpp error tests 2019-03-05 11:02:31 +01:00
Nikita Popov
ae59537d84 Merge branch 'PHP-7.4' 2019-03-05 10:24:38 +01:00
Nikita Popov
b26df0e395 Remove tests for zpp failure conditions
These tests only check zpp error conditions, so drop them per
zpp testing policy.
2019-03-05 10:22:23 +01:00
Peter Kokot
f3fad10d33 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace PHP_TM_GMTOFF with AC_CHECK_MEMBERS
2019-03-04 12:13:22 +01:00
Peter Kokot
a8c3e22d23 Replace PHP_TM_GMTOFF with AC_CHECK_MEMBERS
Changes:
- PHP_TM_GMTOFF removed
- HAVE_TM_GMTOFF replaced with HAVE_STRUCT_TM_TM_GMTOFF
- HAVE_TM_ZONE replaced with HAVE_STRUCT_TM_TM_ZONE
- HAVE_TZNAME removed

The PHP_TM_GMTOFF macro can be replaced with Autoconf's AC_CHECK_MEMBERS
that defines the HAVE_STRUCT_TM_TM_GMTOFF symbol instead of the
HAVE_TM_ZONE.

The HAVE_TZNAME symbol is not used in current code. The obsolete
HAVE_TM_ZONE symbol has been replaced with more proper
HAVE_STRUCT_TM_TM_ZONE. These are defined by the AC_STRUCT_TIMEZONE
macro.
2019-03-04 12:13:12 +01:00
Derick Rethans
29f15a1333 Merge branch 'PHP-7.4' 2019-02-28 13:52:46 +00:00
Derick Rethans
9624e87a8f Merge branch 'PHP-7.3' into PHP-7.4 2019-02-28 13:52:33 +00:00
Derick Rethans
d63a7aa6cf Merge branch 'PHP-7.2' into PHP-7.3 2019-02-28 13:51:10 +00:00
Derick Rethans
a890c5beb8 Fixed bug #50020 (DateInterval:createDateFromString() silently fails) 2019-02-28 13:50:35 +00:00
Nikita Popov
c8e2b333cb Merge branch 'PHP-7.4' 2019-02-20 11:22:31 +01:00
Nikita Popov
c0e15a3b7f Implement fine-grained conflict handling
Tests can specify conflict keys, either in --CONFLICTS-- or
a per-directory CONFLICTS file. Non-conflicting tests may be run
in parallel.
2019-02-20 11:20:40 +01:00
Nikita Popov
29aa080f0d Merge branch 'PHP-7.4' 2019-02-18 15:31:15 +01:00
Andrea Faulds
39792f5bb7 run-tests.php: experimental parallel testing support 2019-02-18 14:58:53 +01:00
Peter Kokot
4572fef9cd Merge branch 'PHP-7.4'
* PHP-7.4:
  Refactor timelib.m4
2019-02-13 19:26:55 +01:00
Peter Kokot
17310fd7d7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Refactor timelib.m4
2019-02-13 19:26:37 +01:00
Peter Kokot
a89948320b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Refactor timelib.m4
2019-02-13 19:26:02 +01:00
Peter Kokot
0ffa84d740 Refactor timelib.m4
The ext/date/lib is bundled library and also includes additional
timelib.m4 macros and checks specific for PHP.

All the checks in the timelib.m4 are already done in the PHP's
configure.ac:
- headers except for io.h and strings.h
- two functions checked strftime and gettimeofday
- if size of longint is 8
- if size of int is 4
- int32_t and uint32_t types using the PHP_CHECK_STDINT_TYPES

Macro `AC_TIMELIB_C_BIGENDIAN` defined in timelib.m4 is not used.

The two checkings for strtoll and atoll have been moved to date extension's
config0.m4 file.

Additional check for headers <io.h> and <strings.h> has been added to
config0.m4 of the date extension.

Therefore the timelib.m4 can be simplified and removed from the bundled
library to have easier maintenance in the later branches and also
upstream library.
2019-02-13 19:24:39 +01:00
Johannes Schlüter
d373d13d4a Merge branch 'PHP-7.4' 2019-02-12 15:02:18 +01:00
Nikita Popov
e27af3bbea Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 09:57:38 +01:00
Nikita Popov
8ed775f548 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 09:57:18 +01:00
Nikita Popov
a109fddba4 Remove "defensive copy" of DatePeriod properties
get_properties() constructs these as fresh objects with no relation
to the internals, there is no need to clone them again. Additionally
the current implementation leaks memory, because the original objects
are never freed (see PR #3121).
2019-02-12 09:54:52 +01:00
Peter Kokot
174542a29b Merge branch 'PHP-7.4'
* PHP-7.4:
  Tests for __set_state magic method
2019-02-09 17:20:07 +01:00
MarkBaker
31b2dcb26c Tests for __set_state magic method
Tests for __set_state magic method for DateTime, DateTimeImmutable,
DateTimeZone and DatePeriod.
2019-02-09 17:18:23 +01:00
Peter Kokot
3d9ee4d690 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add test for date_time_immutable invalid arguments
2019-02-09 17:05:54 +01:00
Mark Niebergall
1253a68926 Add test for date_time_immutable invalid arguments 2019-02-09 17:05:22 +01:00
Nikita Popov
d750f0a192 Merge branch 'PHP-7.4' 2019-02-05 09:41:08 +01:00
Nikita Popov
8bc663f43b Remove zpp variation tests 2019-02-05 09:38:55 +01:00
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03: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
Nikita Popov
5a2787a02d Require at least one arg for mktime/gmmktime 2019-01-30 13:13:47 +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
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
Derick Rethans
362f8b5f97 Merge branch 'PHP-7.3' 2019-01-07 12:49:01 +00:00
Derick Rethans
24b446291d Merge branch 'PHP-7.2' into PHP-7.3 2019-01-07 12:48:49 +00:00
Derick Rethans
bd1d2c7bfe Update tests due to data changes in tzdata 2018i 2019-01-07 12:48:42 +00:00
Derick Rethans
1eedfe70ae Updated to version 2018.9 (2018i) 2019-01-07 11:50:17 +00:00
Derick Rethans
11105e90c4 Updated to version 2018.9 (2018i) 2019-01-07 11:50:16 +00:00
Derick Rethans
81da7f75e3 Updated to version 2018.9 (2018i) 2019-01-07 11:50:14 +00:00
Derick Rethans
e7e8112fcd Merge branch 'PHP-7.3' 2018-12-23 17:57:23 +00:00
Derick Rethans
a9a084c092 Update API use due to changes in timelib 2018.01RC3 2018-12-23 17:54:57 +00:00
Derick Rethans
3e4a3d005a Upgrade timelib to 2018.01RC3 2018-12-23 17:54:37 +00:00
Derick Rethans
6863afe055 Merge branch 'PHP-7.3' 2018-11-28 20:35:35 +00:00
Derick Rethans
dd48f0899d Merge branch 'PHP-7.2' into PHP-7.3 2018-11-28 20:35:16 +00:00
Derick Rethans
a3f2871b8e Fixed bug #77097 (DateTime::diff gives wrong diff when the actual diff is less than 1 second) by upgrading to timelib 2017.09 2018-11-28 20:34:21 +00:00
Nikita Popov
2fac9d9ec1 Remove some mentions of RECOVERABLE_ERROR in tests
Mostly drop error handlers that are no longer necessary.
2018-11-15 22:13:46 +01:00
Dmitry Stogov
0f7f1498be Use ZEND_THIS macro to hide implementation details in extensions code. 2018-11-15 19:54:19 +03:00
Dmitry Stogov
8bda22592e Eliminate useless $this related check 2018-11-14 11:33:14 +03:00
Dmitry Stogov
c6ad0b92b7 Replace getThis() by EX(This), when additional check is not necessary. 2018-11-14 02:44:25 +03:00
Derick Rethans
6ad8edee92 Updated to version 2018.7 (2018g) 2018-10-30 11:25:49 +00:00
Derick Rethans
10255a0cd9 Updated to version 2018.7 (2018g) 2018-10-30 11:25:48 +00:00
Remi Collet
9271f9482b Merge branch 'PHP-7.3'
* PHP-7.3:
  bump to 7.2.13-dev
2018-10-23 12:16:49 +02:00
Derick Rethans
fd3d2755dc Updated to version 2018.6 (2018f) 2018-10-22 12:05:42 +01:00
Derick Rethans
c3a8313136 Updated to version 2018.6 (2018f) 2018-10-22 12:05:40 +01:00
Peter Kokot
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot
b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot
f1d7e3ca0b Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:31:31 +02:00
Peter Kokot
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Derick Rethans
a7c942efee Merge branch 'PHP-7.3' 2018-10-12 11:55:48 +01:00
Derick Rethans
9c608bd13f Upgrade timelib to 2018.01RC1, to fix bug #77007 2018-10-12 11:50:36 +01:00
Derick Rethans
94a98f2c63 Upgrade timelib to 2017.08, to fix bug #77007 2018-10-12 11:41:05 +01:00
Nikita Popov
4f4d0eccaf Specify timezone in test 2018-10-10 13:28:06 +02:00
Nikita Popov
1270e5008a Migrate ext/date to get_properties_for where appropriate
This resolves the long-standing issue where var_dump
a DateTime (etc) object makes a number of additional properties
accessible, which may also change other behaviors as a side-effect.
2018-10-10 10:39:10 +02:00
Derick Rethans
d21aa93dd4 Merge branch 'PHP-7.3' 2018-10-09 11:38:01 +01:00
Derick Rethans
1eac7c1ea3 Fixed tests 2018-10-09 11:37:53 +01:00
Derick Rethans
e47444d1e1 Added test case for bug #75577 2018-10-09 11:08:40 +01:00
Derick Rethans
09340ea9b9 Fixed bug #75577: DateTime::createFromFormat does not accept 'v' format specifier, by updating timelib to 2018.01alpha2 2018-10-09 11:08:40 +01:00
Derick Rethans
d16e23d8c9 Merge branch 'PHP-7.3' 2018-10-09 11:07:15 +01:00
Derick Rethans
bb2eaa6d61 Added test case for bug #75577 2018-10-09 11:06:58 +01:00
Derick Rethans
43f7a5735c Fixed bug #75577: DateTime::createFromFormat does not accept 'v' format specifier, by updating timelib to 2018.01alpha2 2018-10-09 11:06:42 +01:00
Christoph M. Becker
a80456e7dd Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #75851: Year component overflow with date formats "c", "o", "r" and "y"
2018-10-08 11:53:24 +02:00
Christoph M. Becker
e68f60b087 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #75851: Year component overflow with date formats "c", "o", "r" and "y"
2018-10-08 11:52:37 +02:00
Christoph M. Becker
1b97f291a7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #75851: Year component overflow with date formats "c", "o", "r" and "y"
2018-10-08 11:50:37 +02:00
Adam Saponara
c097acd52e Fix #75851: Year component overflow with date formats "c", "o", "r" and "y" 2018-10-08 11:48:58 +02:00
Gabriel Caruso
f72b6c5e19
Use EXPECT instead of EXPECTF when possible 2018-09-16 15:39:18 -03:00
Dmitry Stogov
8939c4d96b Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACT 2018-09-05 13:16:10 +03:00
Gabriel Caruso
2f7003847d
Make more tests run on Linux 2018-08-28 21:20:00 -03:00
Peter Kokot
409b5133cc Change some permissions from 755 to 644
This patch syncs file permissions accross the PHP source code files
since these don't need to be executable.
2018-08-28 23:26:49 +02:00
Gabriel Caruso
84b195d9fc Fix some misspellings 2018-08-12 16:15:45 +02:00
Gabriel Caruso
1461f8ef0d
Remove superfluous SKIPIF sections of always available functions 2018-07-29 15:42:19 -03:00
Peter Kokot
cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +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
Dmitry Stogov
7d4e18b05d Improved user iterator implementation to reduce zend_class_entry memory consumption and avoid race condition during resolving/caching of user iterator functions of internal classes in ZTS build. 2018-07-12 14:04:14 +03:00
Dmitry Stogov
b6cc4d2009 Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code) 2018-07-05 11:54:26 +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
Anatol Belski
c9fc0095ce Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76462 Undefined property: DateInterval::$f
2018-06-12 15:31:49 +02:00
Anatol Belski
5f1190684f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76462 Undefined property: DateInterval::$f
2018-06-12 15:31:01 +02:00
Anatol Belski
7212829435 Fixed bug #76462 Undefined property: DateInterval::$f 2018-06-12 15:30:14 +02:00
Nikita Popov
befc518c82 Merge branch 'PHP-7.2' 2018-06-08 23:11:45 +02:00
Nikita Popov
e029019275 Deduplicate code using php_timezone_to_string()
Looks like this usage was overlooked when the function was
introduced.
2018-06-08 23:10:43 +02:00
David Carlier
ad52ec3db8 cast to int to disable compilation warnings. 2018-06-08 23:08:42 +02:00
Dmitry Stogov
f2b4ec4bdc Export standard object handlers, to avoid indirect access 2018-05-31 11:57:22 +03:00
Pavel Kovář
11b5ec491f Export php_date_get_interval_ce() and php_date_get_period_ce() for extension use 2018-05-23 21:04:07 +02: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
Dmitry Stogov
9565075cbd Destroy function arguments in direct order 2018-05-08 15:28:57 +03:00
Derick Rethans
dc796b04c1 Updated to version 2018.5 (2018e) 2018-05-08 09:24:28 +01:00
Derick Rethans
1a25137a69 Updated to version 2018.5 (2018e) 2018-05-08 09:24:27 +01:00
Derick Rethans
d057d767cc Updated to version 2018.5 (2018e) 2018-05-08 09:24:25 +01:00
Joe Watkins
f37e95a443
Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76131 some arginfo params are different from the documentation
2018-03-27 22:00:31 +02:00
Joe Watkins
3e267ca91b
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76131 some arginfo params are different from the documentation
2018-03-27 21:58:24 +02:00
Gabriel Caruso
63934ea71e
Fix #76131 some arginfo params are different from the documentation 2018-03-27 21:56:46 +02:00
Derick Rethans
f16e0f8bbe Updated to version 2018.4 (2018d) 2018-03-24 11:26:17 +00:00
Derick Rethans
c72c4c5271 Updated to version 2018.4 (2018d) 2018-03-24 11:26:16 +00:00
Derick Rethans
869ca9b733 Updated to version 2018.4 (2018d) 2018-03-24 11:26:15 +00:00
Gabriel Caruso
caa32517ba Use ZEND_ARG_ARRAY_INFO in DateTime*::__set_state 2018-03-23 18:58:42 +01:00
Gabriel Caruso
57896cf515 Make some skipped tests run, and fix some skip messages 2018-03-11 16:38:00 +01:00
Christoph M. Becker
ef255c9f0f Revert "[ci skip] Add missing return types to protos"
This reverts commit a2c7c46d5e.

Since apparently there have been some mistakes in this commit, and it's
not clear yet how to solve them, we're reverting for now.
2018-02-27 17:40:03 +01:00
Gabriel Caruso
a2c7c46d5e [ci skip] Add missing return types to protos 2018-02-24 11:45:17 +01:00
Gabriel Caruso
1314f0fb3a Use int instead of long in protos 2018-02-23 11:06:20 +01:00