Commit graph

1605 commits

Author SHA1 Message Date
Ilija Tovilo
dbcdd4e4a7
Merge branch 'PHP-8.4'
* PHP-8.4:
  Postpone zend_array_sort() in ext-intl
  Use bool for zend_array_sort()
2024-11-04 16:02:47 +01:00
Ilija Tovilo
085c151481
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Postpone zend_array_sort() in ext-intl
  Use bool for zend_array_sort()
2024-11-04 16:02:31 +01:00
Ilija Tovilo
745684290e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Postpone zend_array_sort() in ext-intl
  Use bool for zend_array_sort()
2024-11-04 16:02:16 +01:00
Ilija Tovilo
845cdbce67
Postpone zend_array_sort() in ext-intl
This function is not ZEND_API yet, so we cannot use it as it won't work for
dynamically linked extensions.
2024-11-04 16:01:00 +01:00
Ilija Tovilo
d82fa6adf6
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix array going away during sorting
2024-11-04 15:53:03 +01:00
Ilija Tovilo
230defc198
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix array going away during sorting
2024-11-04 15:51:24 +01:00
Ilija Tovilo
f033cf75e4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix array going away during sorting
2024-11-04 15:51:03 +01:00
Ilija Tovilo
2bdce61390
Fix array going away during sorting
Fixes GH-16648
Closes GH-16654
2024-11-04 15:50:35 +01:00
Christoph M. Becker
9afc66fb51
Fix ICU version specific skip reasons of intl tests (GH-16661)
* Some tests have this backwards, probably reading "skip for ICU …".
  However, that is not how skip reasons are handled.
* Some test seems to have typos in the skip reason version.
* Some tests checked for a certain version, but reported the
  *presumably* next version, which is confusing at best.
* Some tests checked versions in descending order, what is not wrong,
  but confusing.
* Some tests had off by one errors.

For all tests, we assume that the skipif conditions are correct, and
fix the reasons.
2024-11-02 15:48:43 +01:00
Christoph M. Becker
3245a65034
Adapt ext/intl tests for ICU 76.1
Regarding the test names, see PR #9800.

Closes GH-16660.
2024-11-01 22:21:23 +01:00
Christoph M. Becker
e111bf72d7
Adapt ext/intl tests for ICU 75.1
Closes GH-16616.
2024-10-27 18:17:08 +01:00
DanielEScherzer
db545767e5
Rename ZEND_STR_DEPRECATED to ZEND_STR_DEPRECATED_CAPITALIZED (#15831)
To match other capitalized strings like `ZEND_STR_UNKNOWN_CAPITALIZED` and
`ZEND_STR_ARRAY_CAPITALIZED`. Since this known string was only added in PHP
8.4, no backwards compatibility alias is needed.
2024-09-10 22:45:23 +01:00
DanielEScherzer
5dd0575698
Generated arginfo header files: combine preprocessor conditional blocks (#15736)
When functions' or class methods' availability is based on some preprocessor
condition, the generated arginfo header files wrap the declarations in the
preprocessor `#if` conditional blocks, one per declaration, even if they are in
the same conditional block based on comments in the stub file. Instead of
having multiple conditional blocks one after the other with the same condition,
combine them into a single conditional block.
2024-09-04 13:04:22 +02:00
DanielEScherzer
53cb89670c
Generated arginfo header files: remove empty zend_function_entry arrays (#15705)
When a class (or enum) has no methods, rather than using an array that only
contains `ZEND_FE_END`, use `NULL` for the functions. The implementation of
class registration for internal classes, `do_register_internal_class()` in
zend_API.c, already skips classes where the functions are `NULL`. By removing
these unneeded arrays, we can reduce the size of the header files, while also
removing an unneeded call to zend_register_functions() for each internal class
with no extra methods.
2024-09-03 23:19:53 +02:00
Christoph M. Becker
0f8259e896
ICU 75.1 requires C++17 (GH-15678)
This needs to be explicitly enabled for MSVC (and probably clang on
Windows); otherwise the default is C++14, which is no longer sufficient
for ICU[1].

While the official PHP 8.4 builds for Windows do not yet use ICU 75.1,
that may change[2].  And even if not, it would be nice for custom
builds to be able to build against ICU 75.1 (or later).

Anyhow, using `std:c++17` is fine for ICU 72.1 which we are currently
using (and likely for some older ICU versions).

[1] <https://github.com/unicode-org/icu/releases/tag/release-75-1>
[2] <https://github.com/winlibs/icu4c/pulls>
2024-08-31 17:01:49 +02:00
Peter Kokot
fbacc0f936
Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)
The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
2024-08-29 00:44:29 +02:00
Máté Kocsis
8d12f666ae
Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
Christoph M. Becker
450740cbb6
[skip ci] Fix typos in XFAIL reasons 2024-08-22 11:48:46 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
e7c4d54d65 Use new helper function for "cannot be empty" ValueErrors 2024-08-21 21:12:17 +01:00
Peter Kokot
80d784610a
Add date extension to dependencies (#15475)
This is at this point only meta-data information for extensions to
depend also on date extension. This is a configure phase dependency for
consistency.
2024-08-18 16:47:57 +02:00
Gina Peter Bnayard
a1b1a6c925 [skip ci] Remove dead code 2024-08-17 18:14:47 +02:00
Peter Kokot
42c9963133
Autotools: Quote PHP_CXX_COMPILE_STDCXX macro arguments
[skip ci]
2024-08-09 10:39:16 +02:00
Peter Kokot
1ceadaed52
Autotools: Normalize and quote all PHP_NEW_EXTENSION arguments (#15144)
This adds Autoconf quote characters to all PHP_NEW_EXTENSION arguments
and syncs the CS across the php-src Autotools build system.
2024-07-29 00:14:59 +02:00
Peter Kokot
590786adb3
Autotools: Replace PHP_EXT_DIR with $ext_dir (#15133)
- Sync Autoconf syntax
- The PHP_EXT_DIR macro doesn't accept any arguments and since this is
  called after PHP_NEW_EXTENSION, the $ext_dir variable can be used
  instead.
2024-07-28 10:09:26 +02:00
Peter Kokot
a1b45bb87a
Autotools: Sync PHP_SETUP_* M4 macros (#15117)
- arguments quoted
- MYSQLND_HAVE_SSL help text synced
2024-07-27 11:20:07 +02:00
Christoph M. Becker
58ac56f4bb
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15087 IntlChar::foldCase()'s $option is not optional
2024-07-24 16:48:44 +02:00
Christoph M. Becker
ce25be5223
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15087 IntlChar::foldCase()'s $option is not optional
2024-07-24 16:47:03 +02:00
Christoph M. Becker
5fbda73099
Fix GH-15087 IntlChar::foldCase()'s $option is not optional
Since that parameter is supposed to be optional (and has been prior to
PHP 8.0.0), we fix the implementation instead of the stub.

Closes GH-15091.
2024-07-24 16:45:20 +02:00
David Carlier
21418b5bb5
ext/intl: SpoofChecker::setAllowedChars support.
To limit the acceptable range of acceptable unicode chars via individual
ones or via a pattern.
2024-07-22 19:52:56 +01:00
Peter Kokot
6857c7c8d6
Autotools: Expand m4_normalize sooner (#15018)
Quoted m4_normalize will expand and change its argument later in the
macro call when M4 is processing the *.m4 sources. Without quotes the
already normalized string is passed to the macro directly. In these
specific cases generated configure script is the same. This is more for
consistency to have this synced and not repeat the pattern too much
in the future when copy/pasting. Note, that many AC_* macros require
similar behavior already (for example, AC_CHECK_FUNCS.)
2024-07-19 15:20:04 +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
2ebef11e83
Update http links to https and sync www.php.net URLs (#14854) 2024-07-07 04:23:08 +02:00
Peter Kokot
bee84c0468
Autotools: Quote PHP_SUBST arguments in extensions (#14748) 2024-07-02 06:56:18 +02:00
Peter Kokot
c44834d8ad
Trim trailing whitespace (#14721) 2024-06-29 18:41:45 +02:00
Arnaud Le Blanc
11accb5cdf
Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Niels Dossche
cbb81b87f2 intl: change uses of sprintf into snprintf 2024-06-14 08:12:03 -07: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
David CARLIER
c8a8d8aba3
ext/intl last chunk of fast ZPP conversion (#14431) 2024-06-02 10:19:38 +01:00
David CARLIER
354b64720c
ext/intl: calendar/locale use fast ZPP. (#14425) 2024-06-02 08:47:08 +01:00
David CARLIER
9437c32cf4
ext/intl: common use fast ZPP (#14422) 2024-06-01 22:33:12 +01:00
David CARLIER
8c08b03e9b
ext/intl: odn, collator, msgformat using fast ZPP (#14421) 2024-06-01 22:25:00 +01:00
David CARLIER
c39bcaa225
ext/int: UChar using fast ZPP (#14420) 2024-06-01 21:50:07 +01:00
David CARLIER
bc6f3334d1
ext/intl: further fast ZPP usage. (#14419) 2024-06-01 20:48:55 +01:00
Niels Dossche
2f9de8b9e6
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix reference handling in SpoofChecker
2024-06-01 20:45:01 +02:00
Niels Dossche
c87f29f685
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix reference handling in SpoofChecker
2024-06-01 20:40:17 +02:00
David CARLIER
d005ab20ea
ext/intl converter and formatter using fast ZPP (#14413) 2024-06-01 19:36:40 +01:00
Niels Dossche
5ec26edfb6
Fix reference handling in SpoofChecker
Closes GH-14414.
2024-06-01 20:35:57 +02:00
David CARLIER
694bb32119
ext/intl: timezone using fast ZPP and fixing SpoofChecker (#14415) 2024-06-01 19:16:03 +01:00