1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

241 Commits

Author SHA1 Message Date
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
David CARLIER
e97c0dc340 ext/intl: migrate C to C++ code step 5. (#20424) 2025-11-09 21:57:25 +00:00
Bogdan Ungureanu
0ed7424a33 ext/intl: Fix build failure on ICU 62 caused by dateformat (#20198) 2025-10-17 05:55:29 +01:00
David CARLIER
7f65512511 ext/intl: migrate C code to C++ step 3. (#19411) 2025-10-11 14:16:57 +01:00
Niels Dossche
57ce245e1e Reduce code bloat in arginfo by using specialised string releases (#20016)
* Reduce code bloat in arginfo by using specialised string releases

Comparing this patch to master (c7da728574),
with a plain configure command without any options:

```
   text	   data	    bss	    dec	    hex	filename
20683738	1592400	 137712	22413850	156021a	sapi/cli/php
20688522	1592400	 137712	22418634	15614ca	sapi/cli/php_old
```

We see a minor reduction of 0.023% in code size.

* Also use true for the other initialization line

* Also use specialized code for consts
2025-10-02 22:00:20 +02:00
Alexandre Daubois
5a177eedd5 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix memory leak when providing an invalid locale to IntlDateFormatter (#19764)
  Fix intl tests naming (#19763)
2025-09-09 08:42:34 +02:00
Alexandre Daubois
b718514dc2 Fix memory leak when providing an invalid locale to IntlDateFormatter (#19764) 2025-09-09 08:41:32 +02:00
Alexandre Daubois
2d11f4d636 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-11952: better locale strings canonicalization for IntlDateFormatter and NumberFormatter (#19593)
2025-09-08 16:39:50 +02:00
Alexandre Daubois
cc4cfbf984 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-11952: better locale strings canonicalization for IntlDateFormatter and NumberFormatter (#19593)
2025-09-08 16:38:31 +02:00
Alexandre Daubois
6a2adcd8a4 Fix GH-11952: better locale strings canonicalization for IntlDateFormatter and NumberFormatter (#19593) 2025-09-08 16:36:27 +02:00
Gina Peter Banyard
43a91089ca ext/intl: Refactor timezone parameter passing (#19409) 2025-08-08 21:12:43 +01:00
David CARLIER
9ccd2ba9ff Fixed GH-19163 fix ext/intl build on midly older compilers but still supporting C++11. (#19353) 2025-08-05 19:09:37 +01:00
Gina Peter Banyard
6600d0e00f ext/intl: Refactor error handling (#19196)
This is a comprehensive refactoring of the error mechanism of the Intl extension.

By moving the prefixing of the current method/function being executed to actual error message creation by accessing the execution context, we get the following benefits:
- Accurate error messages indicating *what* call caused the error
  - As we *always* "copy" the message, the `copyMsg` arg becomes unused, meaning we can reduce the size of the `intl_error` struct by 4 bytes.
  - Saving it as a zend_string means we know the length of the message
- Remove the need to pass around a "function name" `char*` across multiple calls
- Use Intl's exception mechanism to generate exceptions for constructor call
  - This removes the need for replacing the error handler
  - Which didn't do anything anyway in silent mode, which required throwing non-descriptive exceptions
2025-07-30 16:00:37 +01:00
David CARLIER
063d795599 ext/intl: using a bit more modern c++ memory management features. (#19163)
not always possible (e.g. PHP objects) but when scoped we can manage
here to simplify memory managament starting with IntlDateFormat.
2025-07-18 14:10:40 +01:00
Niels Dossche
be17e9ed54 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix handling of references in zval_try_get_long()
2025-06-04 21:00:22 +02:00
Niels Dossche
2b383848a7 Fix handling of references in zval_try_get_long()
This API can't handle references, yet everyone keeps forgetting that it
can't and that you should DEREF upfront. Fix every type of this issue
once and for all by moving the reference handling to this Zend API.

Closes GH-18761.
2025-06-04 21:00:05 +02:00
Niels Dossche
5f97728780 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix IntlDateFormatter::parseToCalendar() reference type system breaks
  datefmt_parse/datefmt_localtime references type system fixes
  Fix GH-18438: Handling of empty data and errors in ZipArchive::addPattern
2025-04-27 11:33:33 +02:00
Niels Dossche
173dccb646 Fix IntlDateFormatter::parseToCalendar() reference type system breaks
Closes GH-18440.
2025-04-27 11:33:21 +02:00
Niels Dossche
d00adca199 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  datefmt_parse/datefmt_localtime references type system fixes
  Fix GH-18438: Handling of empty data and errors in ZipArchive::addPattern
2025-04-27 11:32:57 +02:00
Niels Dossche
2beec54e47 datefmt_parse/datefmt_localtime references type system fixes
Closes GH-18441.
2025-04-27 11:31:35 +02:00
David Carlier
6c189708a5 Merge branch 'PHP-8.4' 2025-03-15 11:34:52 +00:00
David Carlier
946408251f Merge branch 'PHP-8.3' into PHP-8.4 2025-03-15 11:34:30 +00:00
David Carlier
f34859cb90 ext/intl: Fix dateformat_format when the time is an array of references. 2025-03-15 11:33:17 +00:00
Gina Peter Banyard
a100450cd9 ext/intl: Call DateTimeInterface::getTimestamp() directly (#17487) 2025-01-19 17:28:36 +00: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
Peter Kokot
2ebef11e83 Update http links to https and sync www.php.net URLs (#14854) 2024-07-07 04:23:08 +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
David CARLIER
bc6f3334d1 ext/intl: further fast ZPP usage. (#14419) 2024-06-01 20:48:55 +01:00
Gina Peter Banyard
33f1cf202e ext/intl: Various refactoring (#14360)
* ext/intl: Small extension cleanup

* ext/intl: Normalize cloning error handling behaviour

Always throw a Error exception as we cannot progress from here

* ext/intl: idn.c use ValueErrors where appropriate

Drive-by refactoring

* ext/intl: Remove some unused headers

Probably more cleanup can be done
2024-05-30 12:51:36 +01:00
David Carlier
1cf4cc3894 ext/intl: IntlDateFormatter::parseToCalendar addition.
Unlike IntlDateFormatter::parse, the timezone is updated
accordingly.

Close GH-13779
2024-04-29 18:55:00 +01: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
Máté Kocsis
b5a23d88f5 Explicitly initialize object variables passed to Z_PARAM_OBJ_OF_CLASS_OR_LONG_OR_NULL (#13146)
In order to avoid possible miscompilations like #13082
2024-01-14 16:02:59 +01:00
David Carlier
ba9cf25298 Merge branch 'PHP-8.3' 2024-01-03 17:35:44 +00:00
David Carlier
b32a1cc76f Merge branch 'PHP-8.2' into PHP-8.3 2024-01-03 17:34:54 +00:00
David Carlier
96ffe6ad7e ext/intl: fix bug introduced by 5455c3f
was meant to fix GH-12943.

Close GH-13001.
2024-01-03 17:33:27 +00:00
David Carlier
20c72e1a43 Revert "Merge branch 'PHP-8.3'"
This reverts commit 5455c3fc01, reversing
changes made to ec8e86b96f.
2023-12-23 16:04:46 +00:00
David Carlier
5455c3fc01 Merge branch 'PHP-8.3' 2023-12-22 17:28:29 +00:00
David Carlier
f20edf0fb3 Merge branch 'PHP-8.2' into PHP-8.3 2023-12-22 17:26:20 +00:00
David Carlier
6a447e7437 GH-12943 ext/intl accept C as acceptable locale argument.
Close GH-12955
2023-12-22 17:26:09 +00:00
David Carlier
683e787860 Fix GH-12727: NumberFormatter constructor throws an exception on invalid locale.
Also re-establishing exception throwing on IntlDateFormatter constructor
overwritten by accident most likely so postponing it for next major
release.

Close GH-12868
2023-12-06 06:00:11 +00:00
Dmitry Stogov
110cdd336a Merge branch 'PHP-8.3'
* PHP-8.3:
  Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
  ext/intl: change when the locale is invalid for the 8.1/8.2 serie.
2023-11-02 08:21:36 +03:00
Dmitry Stogov
22735b3ff5 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
  ext/intl: change when the locale is invalid for the 8.1/8.2 serie.
2023-11-02 08:15:50 +03:00
David Carlier
a39e869b55 Merge branch 'PHP-8.1' into PHP-8.2 2023-11-01 19:13:08 +00:00
David Carlier
0da1356c66 ext/intl: change when the locale is invalid for the 8.1/8.2 serie.
does not throws an exception as it's considered as a too string change,
but the code user still needs to double check.
2023-11-01 19:12:50 +00:00
Jorg Adam Sowa
9ad7844160 Typed constants in Intl extenstion (#12360) 2023-10-29 10:50:16 +01:00
David Carlier
ab22571981 Merge branch 'PHP-8.3' 2023-09-23 20:13:45 +01:00
David Carlier
d9e72bcdab Merge branch 'PHP-8.2' into PHP-8.3 2023-09-23 20:12:56 +01:00
David Carlier
36f78862c8 Merge branch 'PHP-8.1' into PHP-8.2 2023-09-23 20:12:41 +01:00
David Carlier
a80db7b52a Fix GH-12282: IntlDateFormatter::construct should throw an exception is the locale field has an invalid value.
Close GH-12282
2023-09-23 20:12:13 +01:00