]> granicus.if.org Git - php/log
php
6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 25 Mar 2019 12:58:56 +0000 (13:58 +0100)]
Merge branch 'PHP-7.4'

6 years agoMake run-tests.php compatible with php 7.0-7.2
Tyson Andre [Sat, 23 Mar 2019 20:47:10 +0000 (16:47 -0400)]
Make run-tests.php compatible with php 7.0-7.2

Motivation:
As an extension author, I want to speed up running tests in php <=7.3,
both locally and in CI (e.g. with valgrind).
This can be done by manually copying php 7.4's run-tests.php script
to replace the one generated by `phpize`

- list() doesn't work in php 7.0
- negative string offset doesn't work in php 7.2

If run-tests.php can be copied from php-src without any manual patches,
that would be the easiest.

Related to #2822 - I didn't see any discussion for/against compatibility
with older php versions

6 years agoMerge branch 'master' of git://github.com/php/php-src
Joe Watkins [Mon, 25 Mar 2019 07:00:57 +0000 (08:00 +0100)]
Merge branch 'master' of git://github.com/php/php-src

6 years agoTSRM cleanup for PHP8
Joe Watkins [Sat, 23 Mar 2019 07:15:53 +0000 (08:15 +0100)]
TSRM cleanup for PHP8

6 years agoMerge branch 'PHP-7.4'
Peter Kokot [Sun, 24 Mar 2019 01:13:20 +0000 (02:13 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Enhance Autoconf version checking

6 years agoEnhance Autoconf version checking
Peter Kokot [Sun, 17 Mar 2019 22:55:37 +0000 (23:55 +0100)]
Enhance Autoconf version checking

With this required Autoconf version is now defined only on two places:
- configure.ac
- scripts/phpize.m4

and additionally:
- Script can be run from other locations
- Synced CS and portability a bit

6 years agoMerge branch 'PHP-7.4'
Peter Kokot [Sun, 24 Mar 2019 00:57:53 +0000 (01:57 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  [ci skip] Move CREDITS from root to README

6 years ago[ci skip] Move CREDITS from root to README
Peter Kokot [Sat, 23 Mar 2019 16:06:56 +0000 (17:06 +0100)]
[ci skip] Move CREDITS from root to README

6 years agoMerge branch 'PHP-7.4'
Peter Kokot [Sun, 24 Mar 2019 00:54:46 +0000 (01:54 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix tokenizer_data_gen.sh for non-posix bison

6 years agoFix tokenizer_data_gen.sh for non-posix bison
Guilliam Xavier [Sat, 23 Mar 2019 14:41:46 +0000 (15:41 +0100)]
Fix tokenizer_data_gen.sh for non-posix bison

And run it to update tokenizer_data.c after recent changes in
zend_language_parser.y that reordered some tokens

6 years agoMerge branch 'PHP-7.4'
Peter Kokot [Sat, 23 Mar 2019 22:26:08 +0000 (23:26 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Remove enable-wddx from Travis compile as it WDDX has been unbundled as of PHP 7.4

6 years agoRemove enable-wddx from Travis compile as it WDDX has been unbundled as of PHP 7.4
George Peter Banyard [Sat, 23 Mar 2019 21:23:05 +0000 (22:23 +0100)]
Remove enable-wddx from Travis compile as it WDDX has been unbundled as of PHP 7.4

6 years agoMerge branch 'PHP-7.4'
Peter Kokot [Sat, 23 Mar 2019 20:11:32 +0000 (21:11 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  [ci skip] Remove text editor modelines

6 years ago[ci skip] Remove text editor modelines
Peter Kokot [Sat, 23 Mar 2019 20:09:38 +0000 (21:09 +0100)]
[ci skip] Remove text editor modelines

These were already removed 92ac598aabd336593a47ed3959f1031674b763e6
and this fixes some leftovers. These files don't really need these
settings.

6 years agoMerge branch 'PHP-7.4'
Joe Watkins [Sat, 23 Mar 2019 08:49:39 +0000 (09:49 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  fix bug #76801: phpdbg too many open files error

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Joe Watkins [Sat, 23 Mar 2019 08:49:03 +0000 (09:49 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  fix bug #76801: phpdbg too many open files error

6 years agoMerge branch 'PHP-7.2' into PHP-7.3
Joe Watkins [Sat, 23 Mar 2019 08:48:04 +0000 (09:48 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  fix bug #76801: phpdbg too many open files error

6 years agofix bug #76801: phpdbg too many open files error
Alessandro Chitolina [Tue, 19 Mar 2019 16:34:34 +0000 (17:34 +0100)]
fix bug #76801: phpdbg too many open files error

6 years agoFor consistency with Windows, and because ZTS is not experimental or a "maintainer...
Joe Watkins [Fri, 22 Mar 2019 09:10:01 +0000 (10:10 +0100)]
For consistency with Windows, and because ZTS is not experimental or a "maintainer" feature, this commits renames --enable-maintainer-zts to --enable-zts in the autotools build, and related documentation

6 years agoMerge branch 'PHP-7.4'
Remi Collet [Fri, 22 Mar 2019 14:32:07 +0000 (15:32 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  ensure pcre.jit=1 for this test

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Fri, 22 Mar 2019 14:31:53 +0000 (15:31 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  ensure pcre.jit=1 for this test

6 years agoensure pcre.jit=1 for this test
Remi Collet [Fri, 22 Mar 2019 14:31:36 +0000 (15:31 +0100)]
ensure pcre.jit=1 for this test

6 years agoMerge branch 'PHP-7.4'
Remi Collet [Fri, 22 Mar 2019 14:02:26 +0000 (15:02 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  ensure pcre.jit=1 for these tests

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Fri, 22 Mar 2019 14:02:13 +0000 (15:02 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  ensure pcre.jit=1 for these tests

6 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Fri, 22 Mar 2019 14:01:49 +0000 (15:01 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  ensure pcre.jit=1 for these tests

6 years agoensure pcre.jit=1 for these tests
Remi Collet [Fri, 22 Mar 2019 14:00:31 +0000 (15:00 +0100)]
ensure pcre.jit=1 for these tests

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 22 Mar 2019 12:07:15 +0000 (13:07 +0100)]
Merge branch 'PHP-7.4'

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 22 Mar 2019 12:07:11 +0000 (13:07 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

6 years agoFixed bug #77773
Nikita Popov [Fri, 22 Mar 2019 12:07:00 +0000 (13:07 +0100)]
Fixed bug #77773

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 22 Mar 2019 11:41:39 +0000 (12:41 +0100)]
Merge branch 'PHP-7.4'

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 22 Mar 2019 11:41:34 +0000 (12:41 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

6 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Fri, 22 Mar 2019 11:40:21 +0000 (12:40 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

6 years agoFixed bug #77772
Nikita Popov [Fri, 22 Mar 2019 11:39:27 +0000 (12:39 +0100)]
Fixed bug #77772

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 22 Mar 2019 09:43:21 +0000 (10:43 +0100)]
Merge branch 'PHP-7.4'

6 years agoImplement new custom object serialization mechanism
Nikita Popov [Tue, 22 Jan 2019 16:47:16 +0000 (17:47 +0100)]
Implement new custom object serialization mechanism

RFC: https://wiki.php.net/rfc/custom_object_serialization

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 22 Mar 2019 09:30:15 +0000 (10:30 +0100)]
Merge branch 'PHP-7.4'

6 years agoRemove HAVE_PCRE/HAVE_BUNDLED_PCRE checks
Nikita Popov [Fri, 22 Mar 2019 09:29:18 +0000 (10:29 +0100)]
Remove HAVE_PCRE/HAVE_BUNDLED_PCRE checks

PCRE is always available.

6 years agoMake zend_hash_sort() return void
rjhdby [Mon, 11 Mar 2019 11:55:25 +0000 (14:55 +0300)]
Make zend_hash_sort() return void

This function always succeeds, so remove the success indicator
return value.

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 22 Mar 2019 08:48:26 +0000 (09:48 +0100)]
Merge branch 'PHP-7.4'

6 years agoDeduplicate code in zend_builtin_functions.c
rjhdby [Mon, 18 Mar 2019 14:17:29 +0000 (17:17 +0300)]
Deduplicate code in zend_builtin_functions.c

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 21 Mar 2019 15:28:19 +0000 (16:28 +0100)]
Merge branch 'PHP-7.4'

6 years agoSwitch to bison location tracking
Nikita Popov [Fri, 15 Mar 2019 11:36:49 +0000 (12:36 +0100)]
Switch to bison location tracking

Locations for AST nodes are now tracked with the help of bison
location tracking. This is more accurate than what we currently do
and easier to extend with more information.

A zend_ast_loc structure is introduced, which is used for the location
stack. Currently it only holds the start lineno, but can be extended
to also hold end lineno and offset/column information in the future.

All AST constructors now accept a zend_ast_loc* as first argument, and
will use it to determine their lineno. Previously this used either the
CG(zend_lineno), or the smallest AST lineno of child nodes.

On the parser side, the location structure for a whole rule can be
obtained using the &@$ character salad.

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 21 Mar 2019 09:23:08 +0000 (10:23 +0100)]
Merge branch 'PHP-7.4'

6 years agoTry to create interned strings in preg_split as well
Nikita Popov [Thu, 21 Mar 2019 09:14:19 +0000 (10:14 +0100)]
Try to create interned strings in preg_split as well

And convert last_match to last_match_offset, which is more
convenient now.

6 years agoCleanup add_offset_pair API
Nikita Popov [Thu, 21 Mar 2019 09:08:29 +0000 (10:08 +0100)]
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...

6 years agoFix bug #73948
Nikita Popov [Tue, 19 Mar 2019 11:11:05 +0000 (12:11 +0100)]
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.

6 years agoMerge branch 'PHP-7.4'
Remi Collet [Thu, 21 Mar 2019 08:20:30 +0000 (09:20 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  fix test
  Sync the changes to ext/filter with 7.4, now that it works.

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Thu, 21 Mar 2019 08:20:03 +0000 (09:20 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  fix test

6 years agofix test
Remi Collet [Thu, 21 Mar 2019 08:19:42 +0000 (09:19 +0100)]
fix test

6 years agoRemove usage of HAVE_HASH_EXT and COMPILE_DL_HASH as ext/hash is always available...
Kalle Sommer Nielsen [Wed, 20 Mar 2019 18:43:35 +0000 (20:43 +0200)]
Remove usage of HAVE_HASH_EXT and COMPILE_DL_HASH as ext/hash is always available (master only)

6 years agoSync the changes to ext/filter with 7.4, now that it works.
Kalle Sommer Nielsen [Wed, 20 Mar 2019 18:09:45 +0000 (20:09 +0200)]
Sync the changes to ext/filter with 7.4, now that it works.

- Removed --with-pcre-dir
- The filter extension can now be built as shared on Unix with ./configure

6 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 20 Mar 2019 13:16:56 +0000 (14:16 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Unbundle ext/wddx

6 years agoUnbundle ext/wddx
Christoph M. Becker [Wed, 20 Mar 2019 13:15:50 +0000 (14:15 +0100)]
Unbundle ext/wddx

The extension is now available from <https://pecl.php.net/package/wddx>.

Cf. <https://wiki.php.net/rfc/deprecate-and-remove-ext-wddx>.

6 years agoMerge branch 'PHP-7.4'
Remi Collet [Wed, 20 Mar 2019 13:08:43 +0000 (14:08 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix tests after fix for #76717

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Wed, 20 Mar 2019 13:08:30 +0000 (14:08 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix tests after fix for #76717

6 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Wed, 20 Mar 2019 13:08:18 +0000 (14:08 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix tests after fix for #76717

6 years agoFix tests after fix for #76717
Remi Collet [Wed, 20 Mar 2019 13:07:26 +0000 (14:07 +0100)]
Fix tests after fix for #76717

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 20 Mar 2019 11:07:05 +0000 (12:07 +0100)]
Merge branch 'PHP-7.4'

6 years agoFixed bug #74345
Nikita Popov [Wed, 20 Mar 2019 11:03:45 +0000 (12:03 +0100)]
Fixed bug #74345

Export zend_release_fcall_info_cache(). It is only necessary to
call it if the fcc may not have been used -- if it is passed to
zend_call_function() and friends, then they will take care of
freeing trampolines.

6 years agoMerge branch 'PHP-7.4'
Remi Collet [Wed, 20 Mar 2019 10:56:12 +0000 (11:56 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  NEWS
  Revert "Fix #77609: Tests from mailparse extension fails"

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Wed, 20 Mar 2019 10:55:44 +0000 (11:55 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  NEWS
  Revert "Fix #77609: Tests from mailparse extension fails"

6 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Wed, 20 Mar 2019 10:55:06 +0000 (11:55 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  NEWS
  Revert "Fix #77609: Tests from mailparse extension fails"

6 years agoNEWS
Remi Collet [Wed, 20 Mar 2019 10:54:49 +0000 (11:54 +0100)]
NEWS

6 years agoRevert "Fix #77609: Tests from mailparse extension fails"
Remi Collet [Wed, 20 Mar 2019 10:54:27 +0000 (11:54 +0100)]
Revert "Fix #77609: Tests from mailparse extension fails"

This reverts commit 3ead67239419632eecb83f0f101ead2021ee6c14.

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 20 Mar 2019 10:40:21 +0000 (11:40 +0100)]
Merge branch 'PHP-7.4'

6 years agoMark bug76348.phpt as online test
Nikita Popov [Tue, 19 Mar 2019 14:47:25 +0000 (15:47 +0100)]
Mark bug76348.phpt as online test

6 years agoMerge branch 'PHP-7.4'
Dmitry Stogov [Tue, 19 Mar 2019 23:41:40 +0000 (02:41 +0300)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed incorrect error message

6 years agoFixed incorrect error message
Dmitry Stogov [Tue, 19 Mar 2019 23:41:08 +0000 (02:41 +0300)]
Fixed incorrect error message

6 years agoMerge branch 'PHP-7.4'
Dmitry Stogov [Tue, 19 Mar 2019 22:32:01 +0000 (01:32 +0300)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed typo

6 years agoFixed typo
Dmitry Stogov [Tue, 19 Mar 2019 22:31:35 +0000 (01:31 +0300)]
Fixed typo

6 years agoMerge branch 'PHP-7.4'
Peter Kokot [Tue, 19 Mar 2019 19:29:36 +0000 (20:29 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Upgrade deprecated directives and use non-posix bison

6 years agoUpgrade deprecated directives and use non-posix bison
Peter Kokot [Mon, 18 Mar 2019 23:33:53 +0000 (00:33 +0100)]
Upgrade deprecated directives and use non-posix bison

With Bison 3.0 some directives are deprecated:
- %name-prefix "x" should be %define api.prefix {x}
- %error-verbose should be %define parse.error verbose

Bison 3.3 also started emiting more warnings and since PHP souce parsers
are not POSIX compliant this patch fixes this as pointed out via
495a46aa1dc564656bf919cb49aae48a31ae15f4.

6 years agoMerge branch 'PHP-7.4'
Peter Kokot [Tue, 19 Mar 2019 19:26:07 +0000 (20:26 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Remove extension readmes

6 years agoRemove extension readmes
Peter Kokot [Mon, 18 Mar 2019 00:26:18 +0000 (01:26 +0100)]
Remove extension readmes

This patch removes several extension readmes in favor of the PHP manual
and where possible.

6 years agoMerge branch 'PHP-7.4'
Sara Golemon [Tue, 19 Mar 2019 18:33:30 +0000 (14:33 -0400)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Bump versions for 7.2.18

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Sara Golemon [Tue, 19 Mar 2019 18:33:13 +0000 (14:33 -0400)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Bump versions for 7.2.18

6 years agoMerge branch 'PHP-7.2' into PHP-7.3
Sara Golemon [Tue, 19 Mar 2019 18:32:28 +0000 (14:32 -0400)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Bump versions for 7.2.18

6 years agoBump versions for 7.2.18
Sara Golemon [Tue, 19 Mar 2019 18:31:01 +0000 (14:31 -0400)]
Bump versions for 7.2.18

6 years agoMerge branch 'PHP-7.4'
Remi Collet [Tue, 19 Mar 2019 15:28:22 +0000 (16:28 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  comment out sqlite3.defensive = 1 follow common practice, this is the default value

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Tue, 19 Mar 2019 15:28:10 +0000 (16:28 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  comment out sqlite3.defensive = 1 follow common practice, this is the default value

6 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Tue, 19 Mar 2019 15:27:57 +0000 (16:27 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  comment out sqlite3.defensive = 1 follow common practice, this is the default value

6 years agocomment out sqlite3.defensive = 1
Remi Collet [Tue, 19 Mar 2019 15:26:26 +0000 (16:26 +0100)]
comment out sqlite3.defensive = 1
follow common practice, this is the default value

6 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 19 Mar 2019 15:22:53 +0000 (16:22 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Prepare main branch for PHP 7.3.5

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 19 Mar 2019 15:22:12 +0000 (16:22 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Prepare main branch for PHP 7.3.5

6 years agoPrepare main branch for PHP 7.3.5
Christoph M. Becker [Tue, 19 Mar 2019 15:20:55 +0000 (16:20 +0100)]
Prepare main branch for PHP 7.3.5

6 years agoMerge branch 'PHP-7.4'
Remi Collet [Tue, 19 Mar 2019 15:16:26 +0000 (16:16 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  fix test for upcoming pcre2 10.33

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Tue, 19 Mar 2019 15:16:13 +0000 (16:16 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  fix test for upcoming pcre2 10.33

6 years agofix test for upcoming pcre2 10.33
Remi Collet [Tue, 19 Mar 2019 15:15:14 +0000 (16:15 +0100)]
fix test for upcoming pcre2 10.33

"group name ..." => "subpattern name ..."

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 19 Mar 2019 14:37:07 +0000 (15:37 +0100)]
Merge branch 'PHP-7.4'

6 years agoRespect OFFSET_CAPTURE when padding preg_match_all() results
Nikita Popov [Tue, 19 Mar 2019 14:35:15 +0000 (15:35 +0100)]
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.

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 19 Mar 2019 12:59:48 +0000 (13:59 +0100)]
Merge branch 'PHP-7.4'

6 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 19 Mar 2019 12:59:43 +0000 (13:59 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

6 years agoFixed bug #76127
Nikita Popov [Tue, 19 Mar 2019 12:57:39 +0000 (13:57 +0100)]
Fixed bug #76127

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

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 19 Mar 2019 12:10:01 +0000 (13:10 +0100)]
Merge branch 'PHP-7.4'

6 years agoDon't create a new array for empty/null match every time
Nikita Popov [Tue, 19 Mar 2019 12:06:21 +0000 (13:06 +0100)]
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.

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 19 Mar 2019 11:02:00 +0000 (12:02 +0100)]
Merge branch 'PHP-7.4'

6 years agoRevert unintended change
Nikita Popov [Tue, 19 Mar 2019 11:00:38 +0000 (12:00 +0100)]
Revert unintended change

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

6 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 19 Mar 2019 10:59:36 +0000 (11:59 +0100)]
Merge branch 'PHP-7.4'

6 years agoUse zend_string for subpat_names table
Nikita Popov [Tue, 19 Mar 2019 10:55:40 +0000 (11:55 +0100)]
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.

6 years agoMerge branch 'PHP-7.4'
Dmitry Stogov [Tue, 19 Mar 2019 10:53:18 +0000 (13:53 +0300)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Improve white-space handling