Commit Graph

2642 Commits

Author SHA1 Message Date
Arnaud Le Blanc
1fbb666545
Use zend_std_build_properties() to access zend_object.properties
The zend_object.properties HashTable needs to be built just in time by calling
rebuild_object_properties() on the object before accessing it. Normally this is
done automatically in zend_std_get_properties(), but we do it manually in a few
places.

In this change I introduce an inline variant of zend_std_build_properties(), and
refactor these places to use it instead of calling rebuild_object_properties()
manually.

rebuild_object_properties() renamed as rebuild_object_properties_internal(), to
enforce usage of zend_std_get_properties() or zend_std_build_properties_ex().

Closes GH-14996
2024-07-18 22:18:38 +02:00
Ilija Tovilo
a26ec58fa1
De-duplicate readonly property modification error message (#14972) 2024-07-16 16:29:40 +02:00
Peter Kokot
0e2e8e0f13
Autotools: Quote all PHP_ADD_BUILD_DIR arguments (#14947)
- All arguments quoted for consistency
- m4_normalize used where list of directories becomes a bit simpler to
  read and see the diff
2024-07-14 16:58:43 +02:00
Tim Düsterhus
29f98e7485
Replace @deprecated by #[\Deprecated] for internal functions / class constants (#14750)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-07-10 16:47:31 +02:00
Peter Kokot
2041c133ac
Normalize AC_CHECK_FUNC* first argument (#14700)
The m4_normalize is for Autoconf < 2.70 (on 2.70 and later versions a
blank-or-newline separated items can be expanded without using
backslash-newline).

This also syncs the 1st argument quotes.
2024-06-28 22:40:24 +02:00
Máté Kocsis
09303ad0e7
Fix some ext/date return types (#14600) 2024-06-18 23:25:09 +02:00
Saki Takamachi
bfc988552f
Fixed GH-14383: Fixed usec was carry up (#14463)
If round to the fractional part of a timestamp, a carry will occur in cases
such as 999 999 9. In that case, set usec to 0 and add/sub 1 to sec.
2024-06-11 19:02:43 +09:00
Peter Kokot
84a0da1574
Sync #if/ifdef/defined (#14508)
This syncs CPP macro conditions:
- _WIN32
- _WIN64
- HAVE_ALLOCA_H
- HAVE_ALPHASORT
- HAVE_ARPA_INET_H
- HAVE_CONFIG_H
- HAVE_DIRENT_H
- HAVE_DLFCN_H
- HAVE_GETTIMEOFDAY
- HAVE_LIBDL
- HAVE_POLL_H
- HAVE_PWD_H
- HAVE_SCANDIR
- HAVE_SYS_FILE_H
- HAVE_SYS_PARAM_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_TIME_H
- HAVE_SYS_TYPES_H
- HAVE_SYS_WAIT_H
- HAVE_UNISTD_H
- PHP_WIN32
- ZEND_WIN32

These are either undefined or defined to 1 in Autotools and Windows.

Follow up of GH-5526 (-Wundef).
2024-06-09 14:23:41 +02:00
Gina Peter Banyard
fd2d869642
Clean-up some more headers (#14416)
Remove unused headers (such as php_ini.h for extensions that don't define INI settings)
Use more specific headers when possible
2024-06-08 17:15:36 +01:00
Gina Peter Banyard
8f6612aca0 ext/date: Fix some [-Wsign-compare] warnings 2024-06-08 17:15:01 +01:00
Peter Kokot
da86eec3db
Sync #if/ifdef/defined (#14371)
These are either undefined or defined to value 1 in Autotools and
Windows:
- HAVE_COMMONCRYPTO_COMMONRANDOM_H
- HAVE_EXIF
- HAVE_FOPENCOOKIE
- HAVE_IF_NAMETOINDEX
- HAVE_LIBICONV
- HAVE_SOCKETS
- HAVE_STRUCT_STAT_ST_RDEV
- HAVE_STRUCT_TM_TM_GMTOFF
- HAVE_STRUCT_TM_TM_ZONE

Follow up of GH-5526 (-Wundef)
2024-06-07 23:45:17 +02:00
Derick Rethans
92d18b2bec
Fixed rounding error with new DateTime[Immutable]::createFromTimestamp method 2024-05-30 14:08:39 +01:00
Jorg Adam Sowa
c4d9a37e81
Typed constants in date extension (#12361) 2024-05-22 13:17:44 +02:00
Cristian Rodríguez
8e62e2b829
Mark multple functions as static (#13864)
* Mark many functions as static

Multiple functions are missing the static qualifier.

* remove unused struct sigactions

struct sigaction act, old_term, old_quit, old_int;
all unused.

* optimizer: minXOR and maxXOR are unused
2024-05-22 13:11:46 +02:00
Derick Rethans
bc9a113a07
Add further ZPP conversions 2024-05-22 10:40:49 +01:00
Max Semenik
6f5ffc2915
ext/date: convert remaining uses of zend_parse_parameters() 2024-05-22 10:40:49 +01:00
Marc Bennewitz
805326fe18
An uninitialized DateTime is UNEXPECTED (#13492) 2024-03-18 16:38:30 +00:00
Máté Kocsis
330cc5cdb2
Deprecate implicit nullable parameter types (#12959)
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-03-13 21:40:26 +01:00
Marc Bennewitz
dbd976a67f
Singular DateTime::[get|set]Microsecond & no tentative return type (#13486)
* Singular DateTime::[get|set]Microsecond & no tentative return type

* Added missing getMicrosecond to DateTimeInterface
2024-03-06 09:18:22 +00:00
Marc Bennewitz
9f586f6c69
Fixed int32 underflow on DateTime::createFromTimestamp (#12775)
* Fixed int32 underflow on DateTime::createFromTimestamp
2024-02-27 14:01:49 +00:00
Máté Kocsis
f2e199e878
Implement "support doc comments for internal classes and functions" (#13266)
Fixes #13130
2024-02-25 08:41:31 +01:00
Máté Kocsis
10957e498c
Do not generate frameless info items when func info generation is disabled
While here, I fixed newlines around arginfo and function entry generation. Previously, newlines were repeated.
2024-02-18 11:39:00 +01:00
Marc Bennewitz
0016b3085c
Added DateTime[Immutable]::[get|set]Microseconds (#12557)
* Added DateTime[Immutable]::[get|set]Microseconds
2024-02-05 12:14:18 +00:00
Derick Rethans
f359c0b115 Updated to version 2024.1 (2024a) 2024-02-02 10:23:36 +00:00
Peter Kokot
52dba99d47 Sync headers installation
This syncs the installed sapi and extension headers on *nix and Windows
systems by installing only what is intended outside of php-src.

- ext/gd: without gd_arginfo.h and gd_compat.h
- ext/hash: php_hash_joaat.h and php_hash_fnv.h added also on Windows
  installation; xxhash/xxhash.h added on both installations as it is
  included in php_hash_xxhash.h; Include path for xxhash.h changed to
  relative so the php_hash_xxhash.h can be included outside of php-src;
  Redundant include flags removed
- ext/iconv: without iconv_arginfo.h
- ext/mysqli: mysqli_mysqlnd.h was missing on Windows
- ext/phar: php_phar.h was missing on Windows
- ext/sodium: php_libsodium.h was missing on *nix
- ext/xml: without xml_arginfo.h
- sapi/cli: cli.h was missing on Windows

Closes GH-13210
Closes GH-13213
2024-01-28 19:50:55 +01:00
David CARLIER
9726721560
general signatures discrepencies fixes (#13122) 2024-01-10 22:19:23 +00:00
Derick Rethans
cba4c409b1 Merge branch 'PHP-8.3' 2024-01-02 11:07:36 +00:00
Derick Rethans
9111a39ffa Merge branch 'PHP-8.2' into PHP-8.3 2024-01-02 11:07:24 +00:00
Derick Rethans
c7816bf730 tzdata 2023d adds an extra transition for Europe/London 2024-01-02 11:07:12 +00:00
Derick Rethans
3e6520ac0f Updated to version 2023.4 (2023d) 2024-01-02 10:21:29 +00:00
Derick Rethans
9f3e120dc0 Updated to version 2023.4 (2023d) 2024-01-02 10:21:28 +00:00
Derick Rethans
99be8b05ae Updated to version 2023.4 (2023d) 2024-01-02 10:21:27 +00:00
Niels Dossche
b34b4d54c3 Fix #44383: PHP DateTime not converted to xsd:datetime
Closes GH-12437.
Closes GH-11725.
2023-12-08 17:26:52 +01:00
Máté Kocsis
adc26424aa Deprecate calling DatePeriod::__construct() with less than 3 arguments 2023-12-04 22:27:59 +01:00
Ilija Tovilo
1ade8ef7d3
[skip ci] Skip failing date test on 32-bit 2023-11-28 00:26:30 +01:00
Ilija Tovilo
f6efd126a5
Fix date createFromTimestamp test (#12766)
Unfortuantely, PHP_INT_MIN cannot be expressed as a literal in PHP, because -NUM
is parsed as (-)(NUM). NUM is restricted to PHP_INT_MAX.
2023-11-24 14:24:32 +01:00
Derick Rethans
a4e80b09cb Merge branch 'PHP-8.3' 2023-11-23 16:18:50 +00:00
Derick Rethans
2e4b660b27 Merge branch 'PHP-8.2' into PHP-8.3 2023-11-23 16:18:43 +00:00
Derick Rethans
28dabaab2f Import timelib 2022.10 2023-11-23 16:06:00 +00:00
Marc Bennewitz
88f2dc6268 Added DateTime[Immutable]::createFromTimestamp / date_create_[immutable]_from_timestamp 2023-11-22 15:24:13 +00:00
Derick Rethans
0dfac0e33b Fixed whitespace and formatting 2023-11-22 14:45:58 +00:00
jorgsowa
e7e5f1f2d4 Extended tests with date constants 2023-11-22 14:41:48 +00:00
Ilija Tovilo
692cea5cbc
Use zend_error_noreturn for E_ERROR consistently
To be clear, these already don't return. zend_error_noreturn just hints at this
fact through the ZEND_NORETURN attribute.

Closes GH-12204
2023-09-14 11:44:55 +02:00
Ayesh Karunaratne
27fb8d1c0c
Fix DateTime exception hierarchy for DateInvalidTimeZoneException (#11970)
`DateInvalidTimeZoneException` is supposed to inherit from `DateException`, but the current stub has `Exception`.
2023-08-14 18:55:38 +02:00
Niels Dossche
17b3af2958 GH-11964: In ext/date/php_date.stub.php, DateRangeError extends itself
According to the RFC[1] it's supposed to extend DateError.

[1] https://wiki.php.net/rfc/datetime-exceptions
2023-08-14 13:57:09 +02:00
Derick Rethans
1bddd4ef44 Merge branch 'PHP-8.2' 2023-08-10 12:11:35 +01:00
Derick Rethans
e157da11f3 Update initialisation check for new PHP-8.3 API 2023-08-09 20:12:41 +01:00
Derick Rethans
b71d2e16e6 Fix GH-11416: Crash with DatePeriod when uninitialised objects are passed in (PHP 8.2+) 2023-08-09 16:10:14 +01:00
Derick Rethans
f8b42da3a4 Merge branch 'PHP-8.2' 2023-08-09 15:39:31 +01:00
Derick Rethans
7f6e98cec7 Merge branch 'PHP-8.1' into PHP-8.2 2023-08-09 15:39:25 +01:00