Commit Graph

2162 Commits

Author SHA1 Message Date
Máté Kocsis
7c3078737f
Generate function entries from stubs for a couple of extensions
Closes GH-5347
2020-04-04 20:41:48 +02:00
Nikita Popov
fb5bfcb75b Add a ZEND_UNCOMPARABLE value
To explicitly indicate that objects are uncomparable. For now
this has no functional difference from the usual 1 return value,
but makes intent clearer.
2020-03-31 12:36:48 +02:00
Christoph M. Becker
6b6f0d63f3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #74940: DateTimeZone loose comparison always true
2020-03-30 09:18:20 +02:00
Christoph M. Becker
a2f8c78183 Fix #74940: DateTimeZone loose comparison always true
Since `DateTimeZone` does not implement a `compare_objects` handler,
nor has any properties, two `DateTimeZone` instances always compare as
being equal, even if they designate totally different timezones.  Even
worse, after calling `var_dump()` on these objects, the actual
comparison may yield a correct result.

We therefore introduce a `compare_objects` handlers, which prevents
different behavior before/after `var_dump()`, and which allows us to
clearly define the intended semantics.
2020-03-30 09:03:40 +02:00
Christoph M. Becker
8ea143a943 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79396: DateTime hour incorrect during DST jump forward
2020-03-19 08:53:46 +01:00
Christoph M. Becker
1d9e716a47 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79396: DateTime hour incorrect during DST jump forward
2020-03-19 08:51:55 +01:00
Nate Brunette
d70058a139 Fix #79396: DateTime hour incorrect during DST jump forward
When you attempt to set the time to a non-existent time occuring during
a DST jump forward, the hour does not move forward correctly.
2020-03-19 08:50:34 +01:00
Máté Kocsis
960318ed95
Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00
Máté Kocsis
ac0853eb26
Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Nikita Popov
58b17906f5 Apply tidy formatting
Mostly reindent PHP scripts to spaces.
2020-02-03 13:41:31 +01:00
Nikita Popov
a66e226713 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix DatePeriod property handling with indirect modification
2020-01-30 13:14:29 +01:00
Nikita Popov
01d30f880a Fix DatePeriod property handling with indirect modification
We do need to implement get_property_ptr_ptr to make arrays work
correctly.
2020-01-30 13:09:47 +01:00
Nikita Popov
0078727866 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix leak in DateTimeImmutable::modify()
2020-01-30 12:17:15 +01:00
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