History log of /PHP-7.4/ext/pcre/php_pcre.c (Results 26 – 50 of 516)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 621b1f03 21-Mar-2019 Nikita Popov

Cleanup add_offset_pair API

Accept the two offsets directly, rather than doing length calculations
at all callsites. Also extract the logic to create a possibly interned
string.

Cleanup add_offset_pair API

Accept the two offsets directly, rather than doing length calculations
at all callsites. Also extract the logic to create a possibly interned
string.

Switch the split implementation to work on a char* subject internally,
because ZSTR_VAL(subject_str) is a mouthful...

show more ...


# 6311581a 19-Mar-2019 Nikita Popov

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.


# f53e7394 19-Mar-2019 Nikita Popov

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_CAPTU

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.

show more ...


# 661bce47 19-Mar-2019 Nikita Popov

Fixed bug #76127

Per documentation, and consistent with other preg functions, we
should return false if an error occurred.


# 4fe3d108 19-Mar-2019 Nikita Popov

Don't create a new array for empty/null match every time

If PREG_OFFSET_CAPTURE is used, unmatched subpatterns will be either
[null, -1] or ['', -1] depending on PREG_UNMATCHED_AS_NULL m

Don't create a new array for empty/null match every time

If PREG_OFFSET_CAPTURE is used, unmatched subpatterns will be either
[null, -1] or ['', -1] depending on PREG_UNMATCHED_AS_NULL mode.
Instead of creating a new array like this every time, cache it inside
a global (per-request -- could make it immutable though).

Additionally check whether the subpattern is an empty string or
single character string and use an existing interned string in that
case. Empty / single-char subpatterns are common, so let's avoid
allocating strings for them.

show more ...


# 38b16274 19-Mar-2019 Nikita Popov

Revert unintended change

I wanted to cache subpat names, but we can't do that because the
cache relives request boundaries.


# 525f19be 19-Mar-2019 Nikita Popov

Use zend_string for subpat_names table

When used with preg_match_all or preg_replace_callback(_array),
subpattern names can be used in the matches array many times.
Switch the subpat

Use zend_string for subpat_names table

When used with preg_match_all or preg_replace_callback(_array),
subpattern names can be used in the matches array many times.
Switch the subpat_names table to use zend_string, so we don't have
to allocate a new string every time. Also don't bother creating the
table if no $matches were passed.

This might be a regression for the case where preg_match() is used
with many trailing named subpatterns that are skipped in the result
array, but that seems rather contrived.

show more ...


# f2438a57 19-Mar-2019 Nikita Popov

Avoid copying subpat twice if named subpats are used


# 12bcdd68 18-Mar-2019 Nikita Popov

Fix #77094: Add flags support for pcre_replace_callback(_array)


# 2b9acd37 18-Mar-2019 Nikita Popov

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

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.

show more ...


# 275fa535 18-Mar-2019 Nikita Popov

Accept zend_string* instead of char* in php_pcre_match_impl()


Revision tags: php-7.3.3RC1, php-7.2.16RC1, php-7.2.15, php-7.3.2, php-7.2.15RC1
# 92ac598a 22-Jan-2019 Peter Kokot

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

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.

show more ...


# 0cf7de1c 30-Jan-2019 Zeev Suraski

Remove yearly range from copyright notice


Revision tags: php-7.3.2RC1, php-5.6.40, php-7.1.26, php-7.3.1, php-7.2.14
# e219ec14 07-Jan-2019 Nikita Popov

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 <bobwe

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>

show more ...


# 2fab3302 02-Jan-2019 Nikita Popov

Use ZEND_PARSE_PARAMETERS_NONE in pcre

Instead of the manual ZEND_PARSE_PARAMETERS_START(0, 0) form.


# 27e9c05e 26-Dec-2018 Nikita Popov

Remove preg_options param from pcre_get_compiled_regex()

This parameter is always zero and not necessary to call pcre2_match.

I'm leaving the parameter behind on the _ex() variant,

Remove preg_options param from pcre_get_compiled_regex()

This parameter is always zero and not necessary to call pcre2_match.

I'm leaving the parameter behind on the _ex() variant, so the preg_flags
are still accessible in some way.

show more ...


# b1deb98c 26-Dec-2018 Nikita Popov

Fixed bug #77338

Set preg_options to 0 in php_pcre_get_compiled_regex(_ex). These
options are intended to be passed to pcre2_match. However, we do
not have any flags that actually ne

Fixed bug #77338

Set preg_options to 0 in php_pcre_get_compiled_regex(_ex). These
options are intended to be passed to pcre2_match. However, we do
not have any flags that actually need to be set during matching
(all relevant flags are set during compilation), and the preg_flags
value is used for PHP-specific flags instead.

This parameter should be removed entirely in master to avoid confusion.

show more ...


Revision tags: php-7.2.14RC1, php-7.3.1RC1, php-5.6.39, php-7.1.25, php-7.2.13, php-7.0.33, php-7.3.0
# ef1269d5 01-Dec-2018 Anatol Belski

Fixed bug #77193 Infinite loop in preg_replace_callback

Don't return preallocated match data more than once in nested calls.


Revision tags: php-7.1.25RC1, php-7.2.13RC1, php-7.3.0RC6, php-7.1.24, php-7.2.12, php-7.3.0RC5, php-7.1.24RC1, php-7.2.12RC1, php-7.3.0RC4, php-7.1.23, php-7.2.11, php-7.3.0RC3, php-7.1.23RC1, php-7.2.11RC1, php-7.3.0RC2, php-5.6.38, php-7.1.22, php-7.3.0RC1, php-7.2.10, php-7.0.32
# 68c34ce0 09-Sep-2018 Anatol Belski

Make a copy unconditionally


# 9278be14 09-Sep-2018 Anatol Belski

Fix memory leak in pcre cache


# c6ddd456 08-Sep-2018 Anatol Belski

Fixed bug #76850 Exit code mangled by set locale/preg_match


Revision tags: php-7.1.22RC1, php-7.3.0beta3, php-7.2.10RC1, php-7.1.21, php-7.2.9, php-7.3.0beta2, php-7.1.21RC1, php-7.3.0beta1, php-7.2.9RC1, php-5.6.37, php-7.1.20, php-7.3.0alpha4, php-7.0.31, php-7.2.8, php-7.1.20RC1, php-7.2.8RC1, php-7.3.0alpha3
# 8d3f8ca1 03-Jul-2018 Peter Kokot

Remove unused Git attributes ident

The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
use

Remove unused Git attributes ident

The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.

show more ...


# 5be44312 19-Jul-2018 Dmitry Stogov

Removed redundand code


# 54ebebd6 19-Jul-2018 Dmitry Stogov

Matching loops optimization


# b81d7129 19-Jul-2018 Dmitry Stogov

Micro optimizations


12345678910>>...21