Commit Graph

493 Commits

Author SHA1 Message Date
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
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +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
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
Christoph M. Becker
01912f93c3 Change default of $variant param of idn_to_ascii() and idn_to_utf8()
According to the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1],
we change the default of the $variant parameter of `idn_to_ascii()` and
`idn_to_utf8()` from `INTL_IDNA_VARIANT_2003` to
`INTL_IDNA_VARIANT_UTS46`.

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
2018-09-15 14:41:30 +02:00
Christoph M. Becker
8a4c2f1621 Require ICU ≥ 50.1
Given that ICU is a set of lively developed libraries, that ICU 50.1
has been released on 2012-11-05, and PHP 7.4 is scheduled to be
released seven years after it, we consider it appropriate to ditch
these legacy versions.

Particularly, that would be a reasonable groundwork to implement part
two of the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], namely
to default idn_to_ascii()'s and idn_to_utf8()'s $variant parameter to
INTL_IDNA_VARIANT_UTS46, which is not defined in ICU < 4.6.

See also the related discussion on internals@[2].

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
[2] <http://news.php.net/php.internals/101626>ff
2018-09-15 13:59:54 +02:00
Christoph M. Becker
f543476e89 Fix off-by-one errors in skip reasons 2018-09-03 12:46:34 +02:00
Anatol Belski
96f30a9160 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76829 Incorrect validation of domain on idn_to_utf8() function
2018-09-01 00:21:02 +02:00
Anatol Belski
b9ca573a1b Fixed bug #76829 Incorrect validation of domain on idn_to_utf8() function
As stated by RFC 5890, U-Labels might be up to 252 Unicode code points
long. This can be fixed in 7.1+ as well, but there might potentially be
issues in some existing apps expecting the output to be max 255 octets
long. Thus it seems to be safer to not to touch stable branches.
2018-09-01 00:14:23 +02:00
Anatol Belski
b151e17bdf Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #74484 MessageFormatter::formatMessage memory corruption
2018-08-09 22:09:52 +02:00
Anatol Belski
3cef5a2476 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #74484 MessageFormatter::formatMessage memory corruption
2018-08-09 22:09:21 +02:00
Anatol Belski
9cc74ba229 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #74484 MessageFormatter::formatMessage memory corruption
2018-08-09 22:08:30 +02:00
Anatol Belski
45a05f3841 Fixed bug #74484 MessageFormatter::formatMessage memory corruption
with 11+ named placeholder
2018-08-09 22:07:24 +02:00
Gabriel Caruso
f47cdd1ee0
Remove invalid SKIPIF sections and make more tests run 2018-08-07 21:23:21 -03:00
Gabriel Caruso
dc4e47710b
Give a reason why the test was skipped
A follow up for c93aba04
2018-08-01 22:18:57 -03:00
Gabriel Caruso
c93aba042f
Give a reason why the test was skipped
This will help us debug why a test was skipped in GCOV
(http://gcov.php.net/viewer.php?version=PHP_HEAD&func=skip), and maybe
put them to run again
2018-07-22 16:41:41 -03:00
Dmitry Stogov
571dac8c8f Fixed tests 2018-07-12 17:17:09 +03:00
Andrea Faulds
e4e9cd8355 Export stdClass objects using (object) cast (fixes #48016)
Before this change, var_export()'s output for stdClass objects calls
the non-existent stdClass::__set_state method, and is therefore useless.

This commit makes var_export() output an (object) cast from an array
instead, which when evaluated, will produce a stdClass object. Other
classes see unchanged output.
2018-07-12 13:22:26 +02:00
Christoph M. Becker
0c4f4481f5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Make newly introduced bug76556.phpt more resilient
2018-07-01 00:23:06 +02:00
Christoph M. Becker
39d668e927 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Make newly introduced bug76556.phpt more resilient
2018-07-01 00:21:34 +02:00
Christoph M. Becker
a72bab1b9a Make newly introduced bug76556.phpt more resilient
Obviously, different compilers mangle the C++ class name differently.
We should neither expect a prefix nor a suffix.
2018-07-01 00:20:32 +02:00
Christoph M. Becker
1b61c3b210 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76556: get_debug_info handler for BreakIterator shows wrong type
2018-06-30 23:22:20 +02:00
Christoph M. Becker
ae163d9a36 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76556: get_debug_info handler for BreakIterator shows wrong type
2018-06-30 23:17:54 +02:00
Christoph M. Becker
1118fca75d Fix #76556: get_debug_info handler for BreakIterator shows wrong type
We use the retrieved type for the "type" element instead of the text.
This has been confused during the PHP 7 upgrade[1].

[1] http://git.php.net/?p=php-src.git;a=commit;h=1d793348067e5769144c0f7efd86428a4137baec
2018-06-30 23:15:02 +02:00
Anatol Belski
836f329114 Merge branch 'PHP-7.2'
* PHP-7.2:
  Prepare tests for ICU 62.1
2018-06-25 11:32:03 +02:00
Anatol Belski
096fd88dcb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Prepare tests for ICU 62.1
2018-06-25 11:31:21 +02:00
Anatol Belski
5af0db88fa Prepare tests for ICU 62.1 2018-06-25 11:30:14 +02:00
Nikita Popov
bc56bb847d Merge branch 'PHP-7.2' 2018-06-13 23:48:37 +02:00
Nikita Popov
d04a1e8d70 Merge branch 'PHP-7.1' into PHP-7.2 2018-06-13 23:48:28 +02:00
Nikita Popov
e77077edeb Make $locale parameter to BreakIterator ctors optional
It's documented as such and already accepts null.
2018-06-13 23:47:20 +02:00
Anatol Belski
12da45ada0 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix tests, ref bug #74385
2018-05-03 17:17:02 +02:00
Anatol Belski
b0def5bde9 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix tests, ref bug #74385
2018-05-03 17:16:42 +02:00
Anatol Belski
6b85926104 Fix tests, ref bug #74385 2018-05-03 17:15:47 +02:00
Anatol Belski
319856dc62 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix memory leak
2018-04-12 18:26:31 +02:00
Anatol Belski
9f4905fb0d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix memory leak
2018-04-12 18:25:58 +02:00
Anatol Belski
5fe6d2134b Fix memory leak 2018-04-12 18:25:27 +02:00
Anatol Belski
39301abbe1 Expose functionality for NFKC_Casefold normalization 2018-04-06 18:14:11 +02:00
Anatol Belski
f9a3519f41 Sync normalizer_get_raw_decomposition() to allow passing form
as it is the case with the other Normalizer methods.
2018-04-06 11:13:15 +02:00
Anatol Belski
36014ad23f Replace the deprecated API by the newer one available with ICU 56+ 2018-04-06 10:12:44 +02:00
Anatol Belski
13a5020f98 Check feature availability as ICU < 49 is still supported 2018-04-05 18:08:49 +02:00
Anatol Belski
a6ac5699b6 Merge branch 'PHP-7.2'
* PHP-7.2:
  Adjust tests for ICU 61.1 compatibility
2018-03-29 14:14:29 +02:00
Anatol Belski
9510611cdd Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Adjust tests for ICU 61.1 compatibility
2018-03-29 14:13:48 +02:00
Anatol Belski
398f56dbc8 Adjust tests for ICU 61.1 compatibility 2018-03-29 14:12:19 +02:00
Paul Crovella
b873d3c288
Add normalizer_get_raw_decomposition function
Implements #76111 https://bugs.php.net/bug.php?id=76111
2018-03-22 23:27:39 +01:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Gabriel Caruso
fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
c6c9e71a5b Add missing SKIPIF sections 2018-02-03 13:54:34 +01:00
Nikita Popov
b2b2b437af Add _IS_NUMBER as cast_object() target type
convert_scalar_to_number() will now call cast_object() with an
_IS_NUMBER argument, in which case the cast handler should return
either an integer or floating point number, whichever is more
appropriate.

Previously convert_scalar_to_number() unconditionally converted
objects to integers instead.

Fixes bug #53033.
Fixes bug #54973.
Fixes bug #73108.
2017-12-26 12:39:06 +01:00