Commit graph

355 commits

Author SHA1 Message Date
Remi Collet
15dcc1817d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  ensure proper settings for test
2019-08-20 16:31:11 +02:00
Remi Collet
08aafbe93e ensure proper settings for test 2019-08-20 16:30:52 +02:00
Nikita Popov
228bae7d74 Use TypeError for preg_replace type check
This is a type violation warning, and as such should use TypeError
in PHP 8.
2019-08-11 14:28:10 +02:00
Stanislav Malyshev
4798570607 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78338: Array cross-border reading in PCRE
2019-07-29 14:51:35 -07:00
Stanislav Malyshev
fd6874c64d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78338: Array cross-border reading in PCRE
2019-07-29 14:51:21 -07:00
Christoph M. Becker
8947fd9e9f Fix #78338: Array cross-border reading in PCRE
We backport r1092 from pcre2.
2019-07-29 14:49:33 -07:00
Peter Kokot
ca93928f99 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix typos
2019-07-21 01:02:51 +02:00
Markus Staab
577ed5bfa4 Fix typos
Closes GH-4447
2019-07-21 01:01:36 +02:00
Sjon Hortensius
05752d3acf Ref #77388: Don't pass BAD_ESCAPE_IS_LITERAL
This option is considered dangerous and unwanted. To allow for more
graceful migration don't error on now ignored X modifier.

Closes GH-4430.
2019-07-18 10:52:27 +02:00
Nikita Popov
b98c148f78 Merge branch 'PHP-7.4' 2019-06-28 15:05:00 +02:00
Nikita Popov
54dd762f59 Set up asan+ubsan scheduled build on azure
Also adds an --asan flag to run-tests.php to setup all the necessary
environment variables. Some tests are marked as skipped because they
are incompatible with asan or too slow.

I'm basing this on the DEBUG_ZTS build, which seems to give us the
most mileage.
2019-06-28 15:00:54 +02: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
Christoph M. Becker
09cdf51bec Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #77827: preg_match does not ignore \r in regex flags
2019-03-31 13:36:59 +02:00
Christoph M. Becker
2733420f82 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77827: preg_match does not ignore \r in regex flags
2019-03-31 13:35:50 +02:00
Christoph M. Becker
d8b7728b0e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77827: preg_match does not ignore \r in regex flags
2019-03-31 13:33:21 +02:00
Christoph M. Becker
88460c017a Fix #77827: preg_match does not ignore \r in regex flags 2019-03-31 13:31:54 +02:00
Remi Collet
598175eff6 Merge branch 'PHP-7.4'
* PHP-7.4:
  ensure pcre.jit=1 for this test
2019-03-22 15:32:07 +01:00
Remi Collet
88c37e0b84 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  ensure pcre.jit=1 for this test
2019-03-22 15:31:53 +01:00
Remi Collet
e68fd40e22 ensure pcre.jit=1 for this test 2019-03-22 15:31:36 +01:00
Remi Collet
68312cb37d Merge branch 'PHP-7.4'
* PHP-7.4:
  ensure pcre.jit=1 for these tests
2019-03-22 15:02:26 +01:00
Remi Collet
cf25a3d64d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  ensure pcre.jit=1 for these tests
2019-03-22 15:02:13 +01:00
Remi Collet
bb47fb0783 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  ensure pcre.jit=1 for these tests
2019-03-22 15:01:49 +01:00
Remi Collet
2e9dccef78 ensure pcre.jit=1 for these tests 2019-03-22 15:00:31 +01:00
Nikita Popov
c4b383d663 Merge branch 'PHP-7.4' 2019-03-21 10:23:08 +01:00
Nikita Popov
6311581ac6 Fix bug #73948
If PREG_UNMATCHED_AS_NULL is used, make sure that unmatched capturing
groups at the end are also set to null, rather than just those in the
middle.
2019-03-21 09:50:20 +01:00
Remi Collet
28003c1c06 Merge branch 'PHP-7.4'
* PHP-7.4:
  fix test for upcoming pcre2 10.33
2019-03-19 16:16:26 +01:00
Remi Collet
29fa3ac8b5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix test for upcoming pcre2 10.33
2019-03-19 16:16:13 +01:00
Remi Collet
c421d9afec fix test for upcoming pcre2 10.33
"group name ..." => "subpattern name ..."
2019-03-19 16:15:14 +01:00
Nikita Popov
a895e58335 Merge branch 'PHP-7.4' 2019-03-19 15:37:07 +01:00
Nikita Popov
f53e7394eb Respect OFFSET_CAPTURE when padding preg_match_all() results
This issue was mentioned in bug #73948. The PREG_PATTERN_ORDER
padding was performed without respecting the PREF_OFFSET_CAPTURE
flag, which resulted in unmatched subpatterns being either null or
[null, -1] depending on where they occur. Now they will always be
[null, -1], consistent with other usages.
2019-03-19 15:35:15 +01:00
Nikita Popov
787652b324 Merge branch 'PHP-7.4' 2019-03-19 13:59:48 +01:00
Nikita Popov
2783670daa Merge branch 'PHP-7.3' into PHP-7.4 2019-03-19 13:59:43 +01:00
Nikita Popov
661bce47ae Fixed bug #76127
Per documentation, and consistent with other preg functions, we
should return false if an error occurred.
2019-03-19 13:57:39 +01:00
Nikita Popov
e4ee38ab22 Merge branch 'PHP-7.4' 2019-03-19 10:40:08 +01:00
Nikita Popov
12bcdd68b4 Fix #77094: Add flags support for pcre_replace_callback(_array) 2019-03-19 10:38:21 +01:00
Nikita Popov
c4e4ef0498 Merge branch 'PHP-7.4' 2019-03-18 16:58:59 +01:00
Nikita Popov
2b9acd37f0 Fixed bug #72685
We currently have a large performance problem when implementing lexers
working on UTF-8 strings in PHP. This kind of code tends to perform a
large number of matches at different offsets on a single string. This
is generally fast. However, if /u mode is used, the full string will
be UTF-8 validated on each match. This results in quadratic runtime.

This patch fixes the issue by adding a IS_STR_VALID_UTF8 flag, which
is set when we have determined that the string is valid UTF8 and
further validation is skipped.

A limitation of this approach is that we can't set the flag for interned
strings. I think this is not a problem for this use-case which will
generally work on dynamic data. If we want to use this flag for other
purposes as well (mbstring?) then it might be worthwhile to UTF-8 validate
strings during interning. But right now this doesn't seem useful.
2019-03-18 16:58:48 +01:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Nikita Popov
10b4113638 Remove more zpp error tests 2019-03-05 17:09:09 +01:00
Nikita Popov
c0e15a3b7f Implement fine-grained conflict handling
Tests can specify conflict keys, either in --CONFLICTS-- or
a per-directory CONFLICTS file. Non-conflicting tests may be run
in parallel.
2019-02-20 11:20:40 +01:00
Andrea Faulds
39792f5bb7 run-tests.php: experimental parallel testing support 2019-02-18 14:58:53 +01:00
Anatol Belski
31f28961a7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77193 Infinite loop in preg_replace_callback
2018-12-01 10:28:56 +01:00
Anatol Belski
ef1269d5c1 Fixed bug #77193 Infinite loop in preg_replace_callback
Don't return preallocated match data more than once in nested calls.
2018-12-01 10:24:06 +01: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
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