]> granicus.if.org Git - php/log
php
3 years agoAdd CLEAN sections to mysqli and PDO mysql tests
Dharman [Fri, 5 Mar 2021 22:26:55 +0000 (22:26 +0000)]
Add CLEAN sections to mysqli and PDO mysql tests

Closes GH-6756.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 15 Mar 2021 09:53:08 +0000 (10:53 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  ext/opcache: fix configure output while checking mmap MAP_ANON support

3 years agoext/opcache: fix configure output while checking mmap MAP_ANON support
Michael Heimpold [Sun, 7 Mar 2021 09:00:43 +0000 (10:00 +0100)]
ext/opcache: fix configure output while checking mmap MAP_ANON support

It seems that f3efb9e3fb introduced a "typo" which may result
in the following confusing message:

checking for mmap() using MAP_ANON shared memory support... no=yes

Let's fix this.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Closes GH-6758.

3 years agoDeprecate mysqli driver_version property
Dharman [Sat, 13 Mar 2021 19:06:17 +0000 (19:06 +0000)]
Deprecate mysqli driver_version property

The driver version hasn't been updated in 13 years, so this number
is essentially meaningless. Check PHP_VERSION_ID instead.

3 years agoRemove dead mysqli_driver_construct() function
Nikita Popov [Mon, 15 Mar 2021 09:40:48 +0000 (10:40 +0100)]
Remove dead mysqli_driver_construct() function

This function was never registered with PHP, and the body is
commented out.

3 years agoClean up mysqli_driver test cases
Dharman [Sat, 13 Mar 2021 18:17:56 +0000 (18:17 +0000)]
Clean up mysqli_driver test cases

And remove an unnecessary test case that is already covered by the
other two.

3 years agoRemove redundant macros in mysqli_driver implementation
Dharman [Sat, 13 Mar 2021 17:56:42 +0000 (17:56 +0000)]
Remove redundant macros in mysqli_driver implementation

This class doesn't define many properties, and the macros make
customization hard.

3 years agoRemove unused mysqli global
Dharman [Sat, 13 Mar 2021 19:42:38 +0000 (19:42 +0000)]
Remove unused mysqli global

And fix formatting issues.

3 years agoclient_info is a constant and doesn't need a connection
Dharman [Fri, 12 Mar 2021 22:02:36 +0000 (22:02 +0000)]
client_info is a constant and doesn't need a connection

Closes GH-6767.

3 years agoUse zend_string* & more legible API for php_get_display_errors_mode()
George Peter Banyard [Sun, 14 Mar 2021 15:05:54 +0000 (15:05 +0000)]
Use zend_string* & more legible API for php_get_display_errors_mode()

3 years agoReturn early on php display error for better legibility
Calison [Sun, 7 Mar 2021 19:21:13 +0000 (16:21 -0300)]
Return early on php display error for better legibility

Closes GH-6760

Signed-off-by: George Peter Banyard <girgias@php.net>
3 years agohash: xxhash: Use canonicalization routine from existing API
Anatol Belski [Sat, 13 Mar 2021 20:34:19 +0000 (21:34 +0100)]
hash: xxhash: Use canonicalization routine from existing API

Signed-off-by: Anatol Belski <ab@php.net>
3 years agoRemove deprecated code
Dmitry Stogov [Fri, 12 Mar 2021 22:04:43 +0000 (01:04 +0300)]
Remove deprecated code

3 years agoFixed compilation warning
Dmitry Stogov [Fri, 12 Mar 2021 18:50:26 +0000 (21:50 +0300)]
Fixed compilation warning

3 years agoInline "array" part of FE_FETCH_R handler into HYBRID VM
Dmitry Stogov [Thu, 11 Mar 2021 19:33:01 +0000 (22:33 +0300)]
Inline "array" part of FE_FETCH_R handler into HYBRID VM

3 years agozend_verify_recv_arg_type_helper is not "cold".
Dmitry Stogov [Thu, 11 Mar 2021 12:57:02 +0000 (15:57 +0300)]
zend_verify_recv_arg_type_helper is not "cold".

3 years agoAvoid repeatable work when error_reporting() is called with the same argument few...
Dmitry Stogov [Thu, 11 Mar 2021 11:27:53 +0000 (14:27 +0300)]
Avoid repeatable work when error_reporting() is called with the same argument few times.

3 years agoInheritance cache optimization
Dmitry Stogov [Thu, 11 Mar 2021 10:42:35 +0000 (13:42 +0300)]
Inheritance cache optimization

3 years agoFixed assertion (ext/opcache/zend_persist.c:327: zend_accel_get_type_map_ptr: Asserti...
Dmitry Stogov [Wed, 10 Mar 2021 14:39:26 +0000 (17:39 +0300)]
Fixed assertion (ext/opcache/zend_persist.c:327: zend_accel_get_type_map_ptr: Assertion `ret > 2' failed)

3 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Wed, 10 Mar 2021 13:04:33 +0000 (16:04 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available for static Thread Local Storage)

3 years agoFixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available for...
Dmitry Stogov [Wed, 10 Mar 2021 13:03:47 +0000 (16:03 +0300)]
Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available for static Thread Local Storage)

3 years agoUse spl_filesystem_object.file_name for SPL_FS_DIR as a cache and prevent multiple...
Dmitry Stogov [Tue, 9 Mar 2021 14:37:24 +0000 (17:37 +0300)]
Use spl_filesystem_object.file_name for SPL_FS_DIR as a cache and prevent multiple file name reconstruction.

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 8 Mar 2021 14:16:55 +0000 (15:16 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #51903: simplexml_load_file() doesn't use HTTP headers

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 8 Mar 2021 14:08:11 +0000 (15:08 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #51903: simplexml_load_file() doesn't use HTTP headers

3 years agoFix #51903: simplexml_load_file() doesn't use HTTP headers
Christoph M. Becker [Wed, 3 Mar 2021 18:23:39 +0000 (19:23 +0100)]
Fix #51903: simplexml_load_file() doesn't use HTTP headers

The `encoding` attribute of the XML declaration is optional; it is good
practice to use external encoding information where available if it is
missing.  Thus, we check for `charset` info of `Content-Type` headers,
and see whether the encoding is supported.

We cater to trailing parameters and quoted-strings, but not to escaped
backslashes and quotes in quoted-strings, since no known character
encoding contains these anyway.

Co-authored-by: Michael Wallner <mike@php.net>
Closes GH-6747.

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 8 Mar 2021 13:52:45 +0000 (14:52 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 8 Mar 2021 13:39:38 +0000 (14:39 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101

3 years agoFix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101
manuel [Fri, 5 Mar 2021 23:59:45 +0000 (00:59 +0100)]
Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101

Don't wait for further responses after a HTTP 101 (Switching Protocols) response

Closes GH-6730.

3 years agoMerge branch 'PHP-8.0'
Máté Kocsis [Fri, 5 Mar 2021 23:56:47 +0000 (00:56 +0100)]
Merge branch 'PHP-8.0'

3 years agoFix the error message of attribute flag validation
Máté Kocsis [Fri, 5 Mar 2021 23:56:25 +0000 (00:56 +0100)]
Fix the error message of attribute flag validation

3 years agoMerge branch 'PHP-8.0'
George Wang [Fri, 5 Mar 2021 16:01:27 +0000 (11:01 -0500)]
Merge branch 'PHP-8.0'

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
George Wang [Fri, 5 Mar 2021 16:00:53 +0000 (11:00 -0500)]
Merge branch 'PHP-7.4' into PHP-8.0

3 years agoMerge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4
George Wang [Fri, 5 Mar 2021 15:57:46 +0000 (10:57 -0500)]
Merge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4

3 years agoLiteSpeed SAPI v7.9: Process manager keeps forked child process alive for longer...
George Wang [Fri, 5 Mar 2021 15:46:12 +0000 (10:46 -0500)]
LiteSpeed SAPI v7.9: Process manager keeps forked child process alive for longer time based on load. Reduces PM overhead for busy setup.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 5 Mar 2021 15:44:25 +0000 (16:44 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Add supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be applied in addition.

3 years agoAdd supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be applied in...
David Carlier [Sat, 27 Feb 2021 14:07:59 +0000 (14:07 +0000)]
Add supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be applied in addition.

Closes GH-6738.

3 years agoReduce date test threshold further
Nikita Popov [Fri, 5 Mar 2021 15:31:24 +0000 (16:31 +0100)]
Reduce date test threshold further

Still seeing the occasional spurious failure.

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Fri, 5 Mar 2021 14:09:26 +0000 (15:09 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Print error code if CreateMutex() fails

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Fri, 5 Mar 2021 14:08:24 +0000 (15:08 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Print error code if CreateMutex() fails

3 years agoPrint error code if CreateMutex() fails
Christoph M. Becker [Tue, 2 Mar 2021 11:19:43 +0000 (12:19 +0100)]
Print error code if CreateMutex() fails

This issue came up recently in a bug report[1]; without the error code,
users can barely guess why the function failed.

[1] <https://bugs.php.net/80812>

Closes GH-6745.

3 years agotypo
Dmitry Stogov [Fri, 5 Mar 2021 09:31:04 +0000 (12:31 +0300)]
typo

3 years agoReduce threshold in ext/date/tests/bug73837.phpt
Nikita Popov [Thu, 4 Mar 2021 16:01:25 +0000 (17:01 +0100)]
Reduce threshold in ext/date/tests/bug73837.phpt

Now that this code is faster, we're seeing many spurious failures.

3 years agoUpdate mysqli tests to work with newer MySQL server
Max Semenik [Thu, 25 Feb 2021 15:51:11 +0000 (18:51 +0300)]
Update mysqli tests to work with newer MySQL server

* @@session.old_passwords is present only in 5.6 and 5.7. Newer versions
  already behave as if they have old_passwords=2.
* SET PASSWORD FOR ... = PASSWORD(...) syntax was removed in 8.0.

For all affected tests, versions that don't support newer SQL are
already explicitly excluded with version checks.

Closes GH-6729.

3 years agoMake the nocache tag actually work
Nikita Popov [Thu, 4 Mar 2021 15:32:58 +0000 (16:32 +0100)]
Make the nocache tag actually work

If nocache is used, then we should return an empty string result,
so the test doesn't get marked as borked.

Also limit to an occurrence at the start, just like other skip
tags.

3 years agoAdd mechanism to skip the skipif cache
Nikita Popov [Thu, 4 Mar 2021 15:26:47 +0000 (16:26 +0100)]
Add mechanism to skip the skipif cache

If the SKIPIF section return nocache, don't cache the result. This
is used by tests that perform complex test set in conjunction with
skip checks, and need to be evaluated every time.

3 years agoFix dynamic func def persist with preloading
Nikita Popov [Thu, 4 Mar 2021 15:15:05 +0000 (16:15 +0100)]
Fix dynamic func def persist with preloading

If we find an existing serialization of the op_array, of course
we also need to actually make use of it...

3 years agorun-tests.php: Preserve .php on leak in one more place
Nikita Popov [Thu, 4 Mar 2021 15:08:53 +0000 (16:08 +0100)]
run-tests.php: Preserve .php on leak in one more place

3 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Thu, 4 Mar 2021 14:28:25 +0000 (17:28 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix ASAN warning (Zend/zend_string.h:165:2: runtime error: null pointer passed as argument 2 of memcpy(), which is declared to never be null)

3 years agoFix ASAN warning (Zend/zend_string.h:165:2: runtime error: null pointer passed as...
Dmitry Stogov [Thu, 4 Mar 2021 14:27:26 +0000 (17:27 +0300)]
Fix ASAN warning (Zend/zend_string.h:165:2: runtime error: null pointer passed as argument 2 of memcpy(), which is declared to never be null)

3 years agoCache haschildren/getchildren methods of recursive iterators.
Dmitry Stogov [Thu, 4 Mar 2021 14:04:55 +0000 (17:04 +0300)]
Cache haschildren/getchildren methods of recursive iterators.

3 years agoRemove duplicated SSL_CTX_set_verify()
twosee [Thu, 4 Mar 2021 06:07:54 +0000 (14:07 +0800)]
Remove duplicated SSL_CTX_set_verify()

Duplicated with line 920.
Our minimal OpenSSL version is v1.0.1 (See https://github.com/openssl/openssl/blob/OpenSSL_1_0_1-stable/ssl/ssl_lib.c#L2039).
Removing it does not affect program behavior.
Closes GH-6751.

3 years agoAvoid useless date conversion
Dmitry Stogov [Thu, 4 Mar 2021 09:27:31 +0000 (12:27 +0300)]
Avoid useless date conversion

3 years agoExplicitly print reference wrappers in debug_zval_dump()
Nikita Popov [Wed, 3 Mar 2021 15:28:39 +0000 (16:28 +0100)]
Explicitly print reference wrappers in debug_zval_dump()

Closes GH-6750.

3 years agoSwitch to new ZPP
Dmitry Stogov [Wed, 3 Mar 2021 23:11:21 +0000 (02:11 +0300)]
Switch to new ZPP

3 years agoSwitch to new ZPP
Dmitry Stogov [Wed, 3 Mar 2021 23:10:53 +0000 (02:10 +0300)]
Switch to new ZPP

3 years agoLoop invariant code motion
Dmitry Stogov [Wed, 3 Mar 2021 23:10:10 +0000 (02:10 +0300)]
Loop invariant code motion

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 3 Mar 2021 21:57:51 +0000 (22:57 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80825: ZipArchive::isCompressionMethodSupported does not exist

3 years agoFix #80825: ZipArchive::isCompressionMethodSupported does not exist
Christoph M. Becker [Wed, 3 Mar 2021 21:56:42 +0000 (22:56 +0100)]
Fix #80825: ZipArchive::isCompressionMethodSupported does not exist

`HAVE_METHOD_SUPPORTED` should have been defined after we updated to
libzip 1.7.1 months ago.

3 years agoAdd test cases for bcmath ValueErrors
Alex McLean [Sun, 21 Feb 2021 12:55:43 +0000 (22:55 +1000)]
Add test cases for bcmath ValueErrors

Closes GH-6714

Signed-off-by: George Peter Banyard <girgias@php.net>
3 years agoReplaced deprecated `hw.ncpu` with `hm. logicalcpu`
Gabriel Caruso [Thu, 7 May 2020 20:55:20 +0000 (22:55 +0200)]
Replaced deprecated `hw.ncpu` with `hm. logicalcpu`

Found that at ziglang/zig#1252.

Closes GH-5541

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 3 Mar 2021 11:05:03 +0000 (12:05 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix test wrt. server.inc changes

3 years agoFix test wrt. server.inc changes
Christoph M. Becker [Wed, 3 Mar 2021 10:56:03 +0000 (11:56 +0100)]
Fix test wrt. server.inc changes

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 3 Mar 2021 09:48:43 +0000 (10:48 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #78719: http wrapper silently ignores long Location headers

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 3 Mar 2021 09:47:09 +0000 (10:47 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #78719: http wrapper silently ignores long Location headers

3 years agoFix #78719: http wrapper silently ignores long Location headers
Christoph M. Becker [Tue, 23 Feb 2021 14:32:54 +0000 (15:32 +0100)]
Fix #78719: http wrapper silently ignores long Location headers

When opening HTTP streams, and reading the headers, we currently
discard header lines longer than `HTTP_HEADER_BLOCK_SIZE` (1024 bytes).
While this is not generally forbidden by RFC 7230, section 3.2.5, it
is not generally allowed either, since that may change the "message
framing or response semantics".

We thus fix this by allowing arbitrarily long header lines.

Closes GH-6720.

3 years agoFix bug #80816 Document the removal of alias class entries from ext/spl
Máté Kocsis [Wed, 3 Mar 2021 08:30:37 +0000 (09:30 +0100)]
Fix bug #80816 Document the removal of alias class entries from ext/spl

Closes GH-6748 [skip-ci]

3 years agoAdd const to zend_extension_version_info.build_id
Levi Morrison [Wed, 3 Mar 2021 01:42:58 +0000 (18:42 -0700)]
Add const to zend_extension_version_info.build_id

This is a follow-up to:
https://github.com/php/php-src/commit/3c6ab4b3ea5854fd44a2945bb65bf027a6c94890

Closes GH-6744.

3 years agoFixed bug #80808
Nikita Popov [Tue, 2 Mar 2021 09:58:35 +0000 (10:58 +0100)]
Fixed bug #80808

If the ZEROFILL flag is set for a field, do not convert it into
an integer (text protocol) or convert it explicitly into a padded
string (binary protocol).

3 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 1 Mar 2021 21:01:01 +0000 (00:01 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)

3 years agoFixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)
Dmitry Stogov [Mon, 1 Mar 2021 20:57:20 +0000 (23:57 +0300)]
Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)

3 years agoOptimized object conversion to array without rebulding properties HashTable
Dmitry Stogov [Mon, 1 Mar 2021 19:37:37 +0000 (22:37 +0300)]
Optimized object conversion to array without rebulding properties HashTable

3 years agoOptimized object encoding without rebulding properties HashTable
Dmitry Stogov [Mon, 1 Mar 2021 19:37:05 +0000 (22:37 +0300)]
Optimized object encoding without rebulding properties HashTable

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 1 Mar 2021 17:50:58 +0000 (18:50 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80751: Comma in recipient name breaks email delivery

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 1 Mar 2021 17:50:11 +0000 (18:50 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80751: Comma in recipient name breaks email delivery

3 years agoFix #80751: Comma in recipient name breaks email delivery
Christoph M. Becker [Mon, 1 Mar 2021 15:18:40 +0000 (16:18 +0100)]
Fix #80751: Comma in recipient name breaks email delivery

So far, `SendText()` simply separates potential email address lists at
any comma, disregarding that commas inside a quoted-string do not
delimit addresses.  We fix that by introducing an own variant of
`strtok_r()` which caters to quoted-strings.

We also make `FormatEmailAddress()` aware of quoted strings.

We do not cater to email address comments, and potentially other quirks
of RFC 5322 email addresses, but catering to quoted-strings is supposed
to solve almost all practical use cases.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
Closes GH-6735.

3 years agoDeclare XMLReader properties
Máté Kocsis [Sun, 28 Feb 2021 21:15:46 +0000 (22:15 +0100)]
Declare XMLReader properties

Closes GH-6741

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 1 Mar 2021 15:30:19 +0000 (16:30 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80811

3 years agoFixed bug #80811
Nikita Popov [Mon, 1 Mar 2021 14:01:09 +0000 (15:01 +0100)]
Fixed bug #80811

When filling in defaults for skipped params, make sure that
reference parameters get the expected reference wrapper.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 1 Mar 2021 15:22:51 +0000 (16:22 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Always remove HT iterators, even for uninit HT

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 1 Mar 2021 15:22:29 +0000 (16:22 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Always remove HT iterators, even for uninit HT

3 years agoAlways remove HT iterators, even for uninit HT
Nikita Popov [Mon, 1 Mar 2021 15:20:31 +0000 (16:20 +0100)]
Always remove HT iterators, even for uninit HT

Fixes oss-fuzz #31423.

3 years agoOptimize serializing class names
Tyson Andre [Fri, 26 Feb 2021 14:48:36 +0000 (09:48 -0500)]
Optimize serializing class names

Because of the memcpy, compilers can't infer that ZSTR_LEN (i.e. class_name->len)
did not change, so they copy it out of memory into a register for the last two
accesses.
php_var_serialize_string already does something similar.

Closes GH-6734

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 1 Mar 2021 14:13:50 +0000 (15:13 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80805

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 1 Mar 2021 14:13:25 +0000 (15:13 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80805

3 years agoFixed bug #80805
Nikita Popov [Fri, 11 Sep 2020 20:36:41 +0000 (22:36 +0200)]
Fixed bug #80805

Handle missing result_var in binary_op_result_type.

(cherry picked from commit 8446e2827585c37d0739f8d44fa8d359cbbb6551)

3 years agoOptimized object serialization without rebulding properties HashTable
Dmitry Stogov [Mon, 1 Mar 2021 13:10:56 +0000 (16:10 +0300)]
Optimized object serialization without rebulding properties HashTable

3 years agoIncomplete class may have only single "MAGIC_MEMBER"
Dmitry Stogov [Mon, 1 Mar 2021 11:53:30 +0000 (14:53 +0300)]
Incomplete class may have only single "MAGIC_MEMBER"

3 years agoChange the order of properties used in foreach(), var_dump(), serialize(), comparison...
Dmitry Stogov [Mon, 1 Mar 2021 10:43:22 +0000 (13:43 +0300)]
Change the order of properties used in foreach(), var_dump(), serialize(), comparison, etc. Now properties are ordered according to their layout in zend_object structure.

3 years agoAdded UPGRADING note.
Dmitry Stogov [Mon, 1 Mar 2021 10:42:34 +0000 (13:42 +0300)]
Added UPGRADING note.

3 years agoReference dynamic functions through dynamic_defs
Nikita Popov [Mon, 18 May 2020 13:46:06 +0000 (15:46 +0200)]
Reference dynamic functions through dynamic_defs

Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then later
possibly renamed. When opcache is not used and a file containing a
closure is repeatedly included, this leads to a very large memory leak,
as the no longer needed closure declarations will never be freed
(https://bugs.php.net/bug.php?id=76982).

With this patch, dynamic functions are instead stored in a
dynamic_func_defs member on the op_array, which opcodes reference
by index. When the parent op_array is destroyed, the dynamic_func_defs
it contains are also destroyed (unless they are stilled used elsewhere,
e.g. because they have been bound, or are used by a live closure). This
resolves the fundamental part of the leak, though doesn't completely
fix it yet due to some arena allocations.

The main non-obvious change here is to static variable handling:
We can't destroy static_variables_ptr in destroy_op_array, as e.g.
that would clear the static variables in a dynamic function when
the op_array containing it is destroyed. Static variable destruction
is separated out for this reason (we already do static variable
destruction separately for normal functions, so we only need to
handle main scripts).

Closes GH-5595.

3 years agoChange the order of properties used for var_dump(), serialize(), comparison, etc.
Dmitry Stogov [Fri, 26 Feb 2021 16:27:55 +0000 (19:27 +0300)]
Change the order of properties used for var_dump(), serialize(), comparison, etc.
Now properties are ordered according to their layout in zend_object structure.

3 years agoFix E_DEPRECATED in zend_vm_gen.php
Max Semenik [Mon, 15 Feb 2021 14:34:41 +0000 (17:34 +0300)]
Fix E_DEPRECATED in zend_vm_gen.php

explode(): Passing null to parameter #2 ($string) of type string is
deprecated

Closes GH-6698.

3 years agorun-tests: drop support for ancient Valgrind versions
Max Semenik [Thu, 25 Feb 2021 10:15:03 +0000 (13:15 +0300)]
run-tests: drop support for ancient Valgrind versions

Valgrind 3.3.0 was released in 2007, not even RHEL has crap older than
this. It could be argued that 3.8.0, released in 2012, could be a safe
cutoff too.

Closes GH-6728.

3 years agoClarify types in XmlReader property handling
Nikita Popov [Mon, 1 Mar 2021 08:54:24 +0000 (09:54 +0100)]
Clarify types in XmlReader property handling

Make it clearer that the specified type is really the only type
that can be returned.

3 years agoRemove useless conditional #ifdef
Patrick Allaert [Fri, 26 Feb 2021 17:33:48 +0000 (18:33 +0100)]
Remove useless conditional #ifdef

Closes GH-6737

Signed-off-by: George Peter Banyard <girgias@php.net>
3 years agoMerge branch 'PHP-8.0'
George Peter Banyard [Sat, 27 Feb 2021 13:14:23 +0000 (13:14 +0000)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix Bug #80800 imap_open() fails when the flags parameter includes CL_EXPUNGE

3 years agoFix Bug #80800 imap_open() fails when the flags parameter includes CL_EXPUNGE
George Peter Banyard [Fri, 26 Feb 2021 03:03:38 +0000 (03:03 +0000)]
Fix Bug #80800 imap_open() fails when the flags parameter includes CL_EXPUNGE

This also affected imap_reopen().
Add a supplementary test that the CL_EXPUNGE flag does have
the intended effect.

Closes GH-6732

3 years agoserialize() optimization
Dmitry Stogov [Fri, 26 Feb 2021 10:30:19 +0000 (13:30 +0300)]
serialize() optimization

3 years agoOptimize out zend_strpprintf() usage for simple concationaton
Dmitry Stogov [Fri, 26 Feb 2021 07:34:30 +0000 (10:34 +0300)]
Optimize out zend_strpprintf() usage for simple concationaton

3 years agoImprove SPL directory and stat() cache using zend_srting* instead of char*
Dmitry Stogov [Thu, 25 Feb 2021 23:28:46 +0000 (02:28 +0300)]
Improve SPL directory and stat() cache using zend_srting* instead of char*