Commit Graph

1384 Commits

Author SHA1 Message Date
Máté Kocsis
e088836bbc
Fix nullable types in PHPDoc 2020-04-12 00:25:33 +02:00
Máté Kocsis
4aa137c6a6
Fix the default value of the $length parameter of grapheme_substr() 2020-04-10 18:17:18 +02:00
Máté Kocsis
3709e74b5e
Store default parameter values of internal functions in arg info
Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-04-08 18:37:51 +02:00
Nikita Popov
2bcc4ab8f4 Verify that all stubs have a return type 2020-04-03 17:59:30 +02:00
Máté Kocsis
305b17e85f
Do not include the same stub multiple times
Closes GH-5322
2020-04-03 14:23:54 +02:00
Máté Kocsis
b6229fbca2
Display nullability in type error messages for internal functions
Closes GH-5327
2020-03-31 16:55:36 +02:00
Nikita Popov
8fd7f02ea4 Make cast_object handler required
Avoid subtle differences in behavior depending on whether the
handler is absent or returns FAILURE.

If you previously set cast_object to NULL, create a handler that
always returns FAILURE instead.
2020-03-31 14:37:49 +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
Nikita Popov
33ef3d64da Use separate typedef for bucket comparison function
Avoid performing the same casting dance inside each sort compare
function.
2020-03-04 12:46:06 +01:00
Máté Kocsis
cb933d63c2
Add stubs for IntlChar
Closes GH-5217
2020-02-28 18:10:52 +01:00
Máté Kocsis
d70e6bdcde
Add stubs for UConverter
Closes GH-5218
2020-02-28 14:37:37 +01:00
Nikita Popov
c5e8c25dda Merge branch 'PHP-7.4'
* PHP-7.4:
  Use type-checked ref assignment in UConverter
2020-02-28 10:22:11 +01:00
Nikita Popov
6d19acf54b Use type-checked ref assignment in UConverter 2020-02-28 10:21:50 +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
81fee9f29f
Get rid of method mapping of BreakIterator classes 2020-02-25 23:05:24 +01:00
Máté Kocsis
bcb7847139
Add stubs for Intl BreakIterator
Closes GH-5207
2020-02-25 23:05:03 +01:00
Nikita Popov
16897aacce Remove unnecessary checks in breakpoint iterator
The result of Z_INTL_BREAKITERATOR_P() cannot be NULL. This type
of macro in general can never be NULL.
2020-02-25 10:06:13 +01:00
Máté Kocsis
ac0853eb26
Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00
Christoph M. Becker
7d0102dfa7 Revert "Replace @param annotations with type declarations"
This reverts commit c31029f335.
2020-02-17 08:55:18 +01:00
Christoph M. Becker
c31029f335 Replace @param annotations with type declarations 2020-02-16 23:43:38 +01:00
Christoph M. Becker
6ee6097688 Constrain number parameter of numfmt_format to int|float
This is inline with similar changes to the math functions.  Especially,
array to number conversion makes no sense here, and is likely to hide
a programming error.

To make that feasible, we introduce the `n` specifier for classic ZPP
so we can stick with `zend_parse_method_parameters()`.

We also remove a test case, which has been degenerated to a ZPP test.
2020-02-16 16:48:35 +01:00
George Peter Banyard
a7e3bbbc55 Fix [-Wmissing-field-initializers] compiler warning in transliterator_methods.c 2020-02-11 00:23:52 +01:00
Máté Kocsis
86780ff79f
Add stubs for NumberFormatter
Closes GH-4827
2020-02-09 22:10:12 +01:00
Máté Kocsis
c42572970a
Add various stubs for Intl
Closes GH-4826
2020-02-04 14:55:21 +01:00
Máté Kocsis
a827db24f1
Add stubs for IntlCalendar
Closes GH-4846
2020-02-04 14:50:02 +01:00
Máté Kocsis
223663807a
Fix ZPP of intl_cal_set() 2020-02-04 14:47:11 +01:00
Máté Kocsis
fe7761b0ad
Add stubs for IntlDateFormatter & MessageFormatter
Closes GH-4812
2020-02-04 13:08:06 +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
Christoph M. Becker
d601b123e7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Relax test expectation
2020-02-03 13:05:54 +01:00
Christoph M. Becker
42e67881c9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Relax test expectation
2020-02-03 13:05:09 +01:00
Christoph M. Becker
b93e4aa11c Relax test expectation
Since we're dealing with floating point numbers, precision issues may
hit us, and actually it's not necessary to check for the exact number
anyway, because it is not exact in the first place.  Therefore, we
relax the test expectations.
2020-02-03 13:03:54 +01:00
Christoph M. Becker
aba6937c0a Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79212: NumberFormatter::format() may detect wrong type
2020-02-03 12:30:42 +01:00
Christoph M. Becker
57b9eca83d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79212: NumberFormatter::format() may detect wrong type
2020-02-03 12:29:43 +01:00
Christoph M. Becker
c2935499b1 Fix #79212: NumberFormatter::format() may detect wrong type
We have to convert to number *before* detecting the type, to cater to
internal objects implementing `cast_object`.

We also get rid of the fallback behavior of using `FORMAT_TYPE_INT32`,
because that can no longer happen; after `convert_scalar_to_number_ex`
the type is either `IS_LONG` or `IS_DOUBLE`.  We cater explicitly to
the `IS_ARRAY` case what also avoids triggering a type confusion when
`::TYPE_INT64` is passed as `$type`.
2020-02-03 12:28:32 +01:00
Máté Kocsis
8b36be268d
Fix indentation and whitespaces in tests
In preparation for GH-5074
2020-01-31 17:47:14 +01:00
Christoph M. Becker
1468484296 Fix #74063: NumberFormatter fails after retrieval from session
While it would be desireable to actually support unserialization of
NumberFormatter instances, at least we should not allow serialization
for now.

We also remove some doubtful tests, which have been added[1] claiming
that they would crash the intl extension, but apparently no fix has
been applied, and the test cases have not been marked as XFAIL.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=ed793b2a3f857fd49c0c1b036062140da5b3e674>
2020-01-30 10:13:29 +01:00
Máté Kocsis
476636841f
Fix #78649 Provide ICU RELATIVE_ constants
Closes GH-5105
2020-01-22 19:59:40 +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
019e8d438c
Throw exception for unconstructed intl objects
Closes GH-5052
2020-01-05 23:55:14 +01:00
Máté Kocsis
aadd3aaed9
Use RETURN_THROWS() in various places 2020-01-03 21:10:24 +01:00
Máté Kocsis
e08ce4c13d
Add stubs for various intl functions
Closes GH-4819
- Add stubs for idn functions
- Add stubs for grapheme functions
- Add stubs for Spoofchecker
- Add stubs for Normalizer
- Add stubs for ResourceBundle
- Fix arginfos
- Add support for union return types
- Fix arginfo for resourcebundle_create()
2020-01-03 18:54:57 +01:00
Máté Kocsis
7b4a4d2ace
Use RETURN_THROWS() after try_convert_to_string() 2020-01-03 17:04:06 +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
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Christoph M. Becker
8060a8507f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78912: INTL Support for accounting format
2019-12-09 16:35:45 +01:00
Christoph M. Becker
505cc77cbe Fix #78912: INTL Support for accounting format
We provide `NumberFormatter::CURRENCY_ACCOUNTING` to wrap
`UNUM_CURRENCY_ACCOUNTING `[1].

[1] <https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266dae97cdd7ed612d07d251021c076efb1c5>
2019-12-09 16:34:56 +01:00
Fabien Villepinte
e2a8cc0114 Fix typo with msgfmt_parse_message() 2019-11-19 19:48:13 +01:00
Máté Kocsis
c58b12334d Add union return types with one class 2019-11-18 12:44:38 +01:00
Christoph M. Becker
5b9725e555 Add missing zend_parse_parameters_none() 2019-11-16 18:20:39 +01:00
Máté Kocsis
65db340ae7 Add stubs for the Locale component of Intl 2019-11-16 18:15:03 +01:00
Stanislav Malyshev
ad0a3f2886 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches
2019-11-11 23:08:52 -08:00
Stanislav Malyshev
686a24c1eb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches
2019-11-11 23:08:44 -08:00
Stanislav Malyshev
ea2a125789 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches
2019-11-11 23:08:38 -08:00
Stanislav Malyshev
2c9926f156 Fix bug #78804 - Segmentation fault in Locale::filterMatches 2019-11-11 22:32:35 -08: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
6d0366ad08 Add stubs for IntlTimeZone 2019-11-04 14:10:01 +01:00
Christoph M. Becker
4008704f62 zend_parse_parameters_throw() is obsolete
Since `zend_parse_parameters()` throws now, there is no reason to
explicitly call `zend_parse_parameters_throw()` anymore, and since both
have actually the same implementation, we redefine the latter as macro.
2019-11-01 16:47:15 +01:00
Máté Kocsis
2204dbde3b Add missing ZPP checks
Closes GH-4878.
2019-11-01 15:26:52 +01:00
Máté Kocsis
969e7a3c8b Cleanup return values for Intl when parameter parsing is unsuccessful
Closes GH-4871.
2019-10-30 13:21:40 +01:00
Nikita Popov
e0be51d082 Use ArgumentCountError in IntlGregorianCalendar ctor 2019-10-30 10:27:52 +01:00
Nikita Popov
c858d17f06 Optimize instanceof_function
Split out the simple equality check into an inline function --
this is one of the common cases.

Replace instanceof_function_ex with zend_class_implements_interface.
There are a few more places where it may be used.
2019-10-25 10:51:17 +02:00
Nikita Popov
1f497b3db7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Skip IntlTimeZone::getOffset() error tests on non-x86
2019-10-24 15:26:24 +02:00
Nikita Popov
93a9b56c90 Skip IntlTimeZone::getOffset() error tests on non-x86
I'm not totally sure, but I have a strong suspicion that the fact
that this produces an error is an artifact of undefined cast behavior
(which will yield INDVAL on x86 but saturate on ARM). INF seems to
be the only value that results in an error even on x86 (variations
like -INF or NAN succeed).

It might make sense to just remove this test entirely, but for now
let's skip it on non-x86.
2019-10-24 15:26:11 +02:00
Christoph M. Becker
0436bc875e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix miscellaneous typos in docs
2019-10-19 19:20:25 +02:00
Tyson Andre
38f388fba4 Fix miscellaneous typos in docs 2019-10-19 19:19:28 +02: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
Christoph M. Becker
487e6e9eca Merge branch 'PHP-7.4'
* PHP-7.4:
  Split intl tests for ICU 65
2019-10-04 13:55:33 +02:00
Christoph M. Becker
884b780667 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Split intl tests for ICU 65
2019-10-04 13:54:49 +02:00
Christoph M. Becker
1ce8c805e2 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Split intl tests for ICU 65
2019-10-04 13:53:58 +02:00
Christoph M. Becker
545412a6cd Split intl tests for ICU 65 2019-10-04 13:53:22 +02: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
f753975c7a Merge branch 'PHP-7.4' 2019-09-25 10:35:26 +02:00
Nikita Popov
a31256d52c Merge branch 'PHP-7.3' into PHP-7.4 2019-09-25 10:34:33 +02:00
Nikita Popov
915fe2fdc6 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-25 10:34:25 +02:00
Jinesh Patel
d2331cc3f2 Fix hash key length in umsg_parse_format()
Fix array length passed to zend_hash_str_find_ptr() casting from
UChar array to char array requires mul by sizeof(UChar).
2019-09-25 10:30:33 +02:00
Remi Collet
d78ffd54ef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Raise minimal GCC version, Test with 4.8 is OK With 4.4: error: #pragma GCC diagnostic not allowed inside functions
2019-09-10 16:29:44 +02:00
Remi Collet
664b1a3f57 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Raise minimal GCC version, Test with 4.8 is OK With 4.4: error: #pragma GCC diagnostic not allowed inside functions
2019-09-10 16:29:30 +02:00
Remi Collet
c43fc204b1 Raise minimal GCC version,
Test with 4.8 is OK
With 4.4: error: #pragma GCC diagnostic not allowed inside functions
2019-09-10 16:28:35 +02:00
Christoph M. Becker
68edbbfe76 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add the last missing SKIPIF
2019-09-04 08:54:07 +02:00
Fabien Villepinte
ced5bb7d88 Add the last missing SKIPIF 2019-09-04 08:53:35 +02:00
Christoph M. Becker
eeb910911d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Suppress deprecation warning on IDNA2003 ICU methods for clang
2019-08-23 12:22:28 +02:00
Christoph M. Becker
c9d31941e4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Suppress deprecation warning on IDNA2003 ICU methods for clang
2019-08-23 12:21:57 +02:00
Christoph M. Becker
ff7029b65b Suppress deprecation warning on IDNA2003 ICU methods for clang 2019-08-23 12:18:58 +02:00
Sara Golemon
bd62f5ac47 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Suppress deprecation warning on IDNA2003 ICU methods
2019-08-16 12:41:32 -04:00
Sara Golemon
a192499d2a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Suppress deprecation warning on IDNA2003 ICU methods
2019-08-16 12:41:02 -04:00
Sara Golemon
725f439778
Suppress deprecation warning on IDNA2003 ICU methods 2019-08-16 12:40:20 -04:00
Sara Golemon
4d3be2a995 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Move to non deprecated API on suitable ICU versions"
2019-08-16 11:40:01 -04:00
Sara Golemon
9b9814fa77
Revert "Move to non deprecated API on suitable ICU versions"
This reverts commit 13a2f2d041.

The APIs used by this commit aren't entirely equivalent to the original ones.
2019-08-16 11:39:05 -04: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
f821256d00 Remove unused is_constructor arguments 2019-07-15 12:36:31 +02:00
Peter Kokot
e0ea444dd3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Convert all php_error_docref0 to php_error_docref
2019-07-13 02:10:17 +02:00
George Peter Banyard
1c1de0c41a Convert all php_error_docref0 to php_error_docref
Closes GH-4394
2019-07-13 02:05:17 +02:00
Nikita Popov
a1479fbbd9 Merge branch 'PHP-7.4' 2019-06-25 14:30:24 +02:00
Nikita Popov
b53bb3c15b Fix UConverter leak 2019-06-25 14:28:58 +02:00
Nikita Popov
77f7ec5152 Fix TimeZone leak in intl MessageFormat
I'm just giving each format a distinct owned object here ... sharing
it looks complicated.
2019-06-25 14:28:58 +02:00
Nikita Popov
452076de44 Merge branch 'PHP-7.4' 2019-06-19 17:27:29 +02:00
Nikita Popov
608097a901 Fix various instances of memcpy null ub 2019-06-19 17:27:09 +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
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02: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
Anatol Belski
793fd6bce9 Fix expect section 2019-06-01 14:50:14 +02:00
Anatol Belski
2205546edf Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Change ZPP only if compiled with ICU >= 64
  Update tests for ICU 64
2019-06-01 02:26:07 +02:00
Anatol Belski
ee153deb1f Change ZPP only if compiled with ICU >= 64 2019-06-01 02:18:56 +02:00
Nikita Popov
b01d9fdab1 Update tests for ICU 64
(cherry picked from commit 8a8bc5c452)
2019-06-01 02:17:16 +02:00
Christoph M. Becker
c89b788a8a Merge branch 'PHP-7.4'
* PHP-7.4:
  SimpleXMLElement and ResourceBundle implement Countable
2019-05-31 19:01:41 +02:00
Thomas Gerbet
bfc10978ef SimpleXMLElement and ResourceBundle implement Countable
Both classes already have a count() method and are considered
countable by \is_countable().
2019-05-31 18:59:19 +02:00
Nikita Popov
f20b2c71e5 Merge branch 'PHP-7.4' 2019-05-31 15:40:04 +02:00
Nikita Popov
8a8bc5c452 Update tests for ICU 64 2019-05-31 15:39:03 +02:00
Nikita Popov
45a0656e95 Remove get() object handler
Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
2019-05-29 17:15:19 +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
f95b27c6f6 Convert CRLF to LF
These files are tracked with CRLF line endings in Git and can be
converted to LF. Neither are parts of tests or code itself.
2019-05-13 03:51:00 +02:00
Peter Kokot
5827aca5f1 Merge branch 'PHP-7.4'
* PHP-7.4:
  [ci skip] Migrate intl error conventions docs to Markdown
2019-05-12 23:24:08 +02:00
Peter Kokot
6abc6baa2a [ci skip] Migrate intl error conventions docs to Markdown 2019-05-12 23:24:03 +02: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
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Dmitry Stogov
2e4686b566 Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:16:47 +03:00
Dmitry Stogov
34db07567d Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal functions. 2019-04-24 16:14:48 +03:00
Nikita Popov
daa78d7749 Merge branch 'PHP-7.4' 2019-04-15 15:28:07 +02:00
Nikita Popov
2d7d5ab5c6 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-15 15:27:37 +02:00
Nikita Popov
a2f3ec1777 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-15 15:27:30 +02:00
Nikita Popov
619c4e9f2e Fixed bug #77895 2019-04-15 15:26:58 +02:00
Nikita Popov
cd22cfb5d2 Merge branch 'PHP-7.4' 2019-03-18 12:16:24 +01:00
Nikita Popov
7ad04a0537 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 12:16:18 +01:00
Nikita Popov
763a7b8ca3 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 12:16:12 +01:00
Nikita Popov
b3a669bec1 Make test independent of icu version
We don't really care about the actual output here, just that it
doesn't fail.
2019-03-18 12:14:58 +01:00
Nikita Popov
e0cbb80d29 Merge branch 'PHP-7.4' 2019-03-18 11:41:24 +01:00
Nikita Popov
65c9a3f1a1 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 11:41:19 +01:00
Nikita Popov
623a11d7de Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 11:39:58 +01:00
Nikita Popov
433758ceb3 Allow DateTimeImmutable in datefmt_format_object()
As pointed out in a comment on bug #65683.
2019-03-18 11:39:16 +01:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Nikita Popov
86ef425177 Intl: Don't separately report "bad arguments" errors
zpp will be throwing for these now, don't report them in addition to
that.
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
Peter Kokot
80bebdd0e1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean *nix build system
2019-03-07 21:00:36 +01:00
Peter Kokot
f5fa9ddbd5 Clean *nix build system
- remove some outdated and not used macro calls
- remove some unused variables
- Remove not needed comment from tokenizer config.m4
- Remove not needed comment
- remove not needed local variables for editors and syntax highlighting
2019-03-07 20:58:14 +01:00
Peter Kokot
d0fd9fe977 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add AS_HELP_STRING to *nix build configure options
2019-03-07 20:38:04 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Peter Kokot
9a0345e0dd Merge branch 'PHP-7.4'
* PHP-7.4:
  added basic test for UConverter::setSourceEncoding()
2019-02-19 03:18:54 +01:00
Andy McNeice
5bbf0c698f added basic test for UConverter::setSourceEncoding() 2019-02-19 03:18:26 +01:00
Peter Kokot
4e00d55bd6 Merge branch 'PHP-7.4'
* PHP-7.4:
  added basic test for UConverter::getDestinationEncoding()
2019-02-19 03:15:42 +01:00
Andy McNeice
d194ceb0c2 added basic test for UConverter::getDestinationEncoding() 2019-02-19 03:15:01 +01:00
Peter Kokot
46a1d23b23 Merge branch 'PHP-7.4'
* PHP-7.4:
  added basic test for UConverter::getSourceEncoding()
2019-02-19 03:10:42 +01:00
Andy McNeice
6d9a4f11e6 added basic test for UConverter::getSourceEncoding() 2019-02-19 03:09:49 +01:00
Peter Kokot
17baa87fad Merge branch 'PHP-7.4'
* PHP-7.4:
  Update and fix remaining year ranges (2019)
2019-02-08 23:15:49 +01:00
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01:00
Nikita Popov
480fa42255 Remove unnecessary setting of error_reporting in intl tests 2019-02-05 14:22:20 +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
f8038f827c Remove intl Normalizer::NONE 2019-01-30 16:35:32 +01:00
Christoph M. Becker
3d15a6f86b Remove deprecated INTL_IDNA_VARIANT_2003
Cf. <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
2019-01-28 15:18:01 +01: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
Hugh McMaster
20fa2e7b58 ext/intl: Use pkg-config to detect icu
The developers of icu recommend using pkg-config to detect icu,
because icu-config is deprecated.
2018-12-09 16:59:24 +01:00
Gabriel Caruso
cdd8368d6f Clean up unnecessary ternary expressions and simplify some returns
- Simplify conditions
- Use ZEND_HASH_APPLY_* instead of hard-coded booleans
- Use ZEND_NORMALIZE_BOOL
- Drop sign in favor of ZEND_NORMALIZE_BOOL
2018-12-03 01:22:14 +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
Anatol Belski
63353b95c6 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix tests for ICU 63.1
2018-10-20 23:05:38 +02:00
Anatol Belski
7f8efd9a6e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests for ICU 63.1
2018-10-20 23:04:54 +02:00
Anatol Belski
ba43d5acef Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix tests for ICU 63.1
2018-10-20 23:04:15 +02:00
Anatol Belski
4461fb9c26 Fix tests for ICU 63.1
The most of change is U+00A0 vs. new U+202F used in some outputs.
2018-10-20 23:02:06 +02: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
113213f027 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:29:24 +02:00
Anatol Belski
a04cd4b948 Remove assignment irrelevant for release build 2018-10-14 21:35:57 +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
Peter Kokot
7af945e271 Trim trailing whitespace in *.phpt 2018-10-14 19:43:12 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

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-14 12:56:38 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

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-14 12:55:24 +02:00
Peter Kokot
60a69daec6 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

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-14 12:54:08 +02:00
Peter Kokot
03f3b8479b Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

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-14 12:51:01 +02:00
Peter Kokot
37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Peter Kokot
3362620b5f Trim trailing whitespace in source code files 2018-10-13 14:16:33 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Peter Kokot
7f6387b59a Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
Peter Kokot
be2ddc6b65 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:23:52 +02:00
Peter Kokot
85290bbfcc Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:23:20 +02:00
Peter Kokot
2aa897476f Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:22:30 +02:00
Peter Kokot
3f72c77ce4 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:21:27 +02:00
Anatol Belski
4acc8500ac Enforce C++11 in ext/intl
ICU 59 already requires C++11 by default. The minimum version required
by the core is 50, which is compiled with at least C++11 in many distros
as package defs tell. Headers for ICU versions between ICU 50 and 58 look
fine when included for C++11 compilation, the linking is thereof not affected.

The macro PHP_CXX_COMPILE_STDCXX is based on
https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
The patch consists on allowing to read the corresponding switch in a user
defined variable instead of enforcing CXXFLAGS globally. That way, every
ext or SAPI can decide, which C++ standard is to be used. The
documentation is provided in the m4 file.

C++11 is already somewhat older standard, C++14 were better. However
issues with GCC < 5.0 and some other compilers are possibly to hit back.
Still there's some time to check for C++14 for ext/intl, too. Having said
that, C++11 in ext/intl and a mechanism to determine features is a good step
towards better C++ support.
2018-10-07 20:00:03 +02:00
Anatol Belski
72df422d69 Add test for bug #76942 2018-10-05 22:54:50 +02:00
Anatol Belski
55e0bc9532 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add test for bug #76942
  Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH
2018-10-05 22:53:11 +02:00
Anatol Belski
a7754286d2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add test for bug #76942
  Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH
2018-10-05 22:52:53 +02:00
Anatol Belski
c2a956de6f Add test for bug #76942 2018-10-05 22:51:58 +02:00
Anatol Belski
534684d104 Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH
ref bug #74484
2018-10-05 22:50:34 +02:00
Nikita Popov
e947bcaf39 Simplify buffer management in php_intl_idn_to_46()
Instead of manually tracking how/whether the buffer is used, make
use of the string refcount.
2018-09-18 12:46:30 +02:00
Nikita Popov
208f5b0941 Merge branch 'PHP-7.3' 2018-09-18 12:39:13 +02:00
Nikita Popov
9f4ec45aa6 Remove invalid free
The initialization of buffer has been moved further down in 7.3,
so this free is no longer legal.
2018-09-18 12:38:46 +02:00