1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

125107 Commits

Author SHA1 Message Date
Kamil Tekiela abacd91cc8 Merge branch 'PHP-8.0'
* PHP-8.0:
  Prevent mysqli::next_result from reporting errors from previous calls (#7304)
2021-07-27 11:57:39 +01:00
Kamil Tekiela 65e2dbd0de Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Prevent mysqli::next_result from reporting errors from previous calls (#7304)
2021-07-27 11:56:14 +01:00
Kamil Tekiela d26069a2f1 Prevent mysqli::next_result from reporting errors from previous calls (#7304) 2021-07-27 11:50:28 +01:00
Nikita Popov 8675380b67 Increment refcounts in mutable data copies
For mutable_data on preloaded classes, there may be refcounted
values in the constants/properties table.
2021-07-27 12:29:46 +02:00
Christoph M. Becker ccb6642c91 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81294: Segfault when removing a filter
2021-07-27 12:17:07 +02:00
Christoph M. Becker bf9afc184f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81294: Segfault when removing a filter
2021-07-27 12:14:22 +02:00
Christoph M. Becker 1fa26eccba Fix #81294: Segfault when removing a filter
We need to call the proper method.

Closes GH-7308.
2021-07-27 12:12:02 +02:00
Nikita Popov 1bd6fafa2f Fix preloading of trait property attributes 2021-07-27 12:07:22 +02:00
Nikita Popov 5a7e1a7aa8 Don't use IMMUTABLE flag to decide whether mutable_data is used
mutable_data may be used for IMMUTABLE classes, internal classes
and to-be-preloaded classes. Check whether the mutable_data
map_ptr is set rather than only the IMMUTABLE flag.
2021-07-27 11:44:01 +02:00
Nikita Popov b35418402f Allocate map_ptr for mutable_data during preloading
We need to discard objects in the class constants if they happened
to be evaluated during preloading. To allow doing so, we need to
use mutable_data, which will place the evaluated constants into
a separate table.
2021-07-27 11:16:38 +02:00
Nikita Popov aef3bb70f4 Fix enum cast AST allocation, again
We always need to allocate space for the three children, and only
don't need one of the zend_ast_zval structures.
2021-07-27 11:05:45 +02:00
Nikita Popov c1959e63e5 Fix preloading of enums
We should not store constants that resolve to objects.
2021-07-27 11:01:44 +02:00
Nikita Popov 703e92c121 Don't force constant resolution for include preloading
Same as with property types, we no longer require that all constants
are resolved for preloading to work, it's just an optimization. As
such, drop the forced resolution for include-based preloading and
just keep the optimization.
2021-07-27 10:50:31 +02:00
Nikita Popov 645ef62693 Fix enum cast AST allocation
I missed this occurrence of the hardcoded number "3".
2021-07-27 10:44:33 +02:00
Nikita Popov 70195c3561 Don't force property type resolution for include preloading
Having all property types resolved is no longer a hard requirement
for preloading, resolving the types is just an optimization. As
such, drop the special logic that forced loading of property
types when include-based preloading is used. Instead only keep
the code that resolves types based on actually preloaded classes.

Also drop the ZEND_ACC_PROPERTY_TYPES_RESOLVED flag, which is now
nearly useless and takes up flag space...
2021-07-27 10:36:21 +02:00
Nikita Popov 56ef117419 Remove special ctor handling in abstract class verification
This seems to be some kind of leftover from PHP 4 ctor support.
2021-07-27 10:16:47 +02:00
Máté Kocsis 663536d7d9 Improve class inheritance error messages (#7307) 2021-07-27 09:42:37 +02:00
Nikita Popov a374230c15 Add support for internal enums
This adds support for internal enums with the same basic approach
as userland enums. Enum values are stored as CONSTANT_AST and
objects created during constant updating at runtime. This means
that we need to use mutable_data for internal enums.

This just adds basic support and APIs, it does not include the
stubs integration from #7212.

Closes GH-7302.
2021-07-27 09:19:14 +02:00
Christoph M. Becker ff8e04ac30 [ci skip] UPGRADING: oci8.old_oci_close_semantics has been deprecated 2021-07-25 14:51:15 +02:00
Máté Kocsis 3babe9576e Validate that promoted readonly properties have a type 2021-07-25 13:13:19 +02:00
Máté Kocsis 8d25b62414 Display the readonly property modifier when printing reflection info 2021-07-25 12:13:48 +02:00
Christoph M. Becker f5ee3429db Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81283: shmop can't read beyond 2147483647 bytes
2021-07-23 17:51:15 +02:00
Christoph M. Becker 71879d385e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81283: shmop can't read beyond 2147483647 bytes
2021-07-23 17:49:56 +02:00
Christoph M. Becker 387c0de983 Fix #81283: shmop can't read beyond 2147483647 bytes
`start`, `count` and `shmop->size` are `zend_long`, so we must not
restrict to `INT_MAX`.

Closes GH-7301.
2021-07-23 17:46:42 +02:00
Nikita Popov c4f4f1ece7 Share zval_make_interned_string() helper
The same function was defined in zend_compile.c and zend_API.c.
2021-07-23 16:10:34 +02:00
Nikita Popov 36d2dd087a Remove redundant static_members/mutable_data cleanup
static_members, mutable_data and static vars in methods are cleaned
up during an earlier shutdown phase (because this has to happen
before we destroy the object store). There is no need to repeat
this cleanup when destroying the classes.
2021-07-23 13:01:40 +02:00
Nikita Popov 89d0115409 Remove zend_cleanup_internal_classes()
If fast_shutdown is used, then we don't need to destroy static
members at all. If fast_shutdown is not used, then we already
loop over classes to destroy static members and static variables
in methods.
2021-07-23 12:51:47 +02:00
Nikita Popov 8befb6d84f Assert that call to method always has called scope or object 2021-07-23 11:26:39 +02:00
Nikita Popov 921e1052db Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #66719
2021-07-23 11:25:17 +02:00
Nikita Popov 90ee1c36d7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #66719
2021-07-23 11:24:59 +02:00
Nikita Popov dfd05da97f Fix bug #66719
While parent:: should inherit the called scope, it should only do
so if it is compatible. If there is no called scope, or it is not
a subtype of the scope, we should fall back to the scope.
2021-07-23 11:24:22 +02:00
Nikita Popov a8926474cb Set called_scope in __callStatic closure trampoline 2021-07-23 10:58:05 +02:00
Nikita Popov 338a47bb85 Fix bug #63327
Use ZEND_MM_ALIGNED_SIZE for the extra size information.
I don't have a relevant system to test, but this should fix the
issue as long as required alignment is detected correctly.
2021-07-23 10:29:44 +02:00
Nikita Popov 5ac55af5e5 Add test for bug #80564
This has also been fixed by 3eb97a4566.
2021-07-23 09:45:39 +02:00
Nikita Popov 3eb97a4566 Always use separate static_members_table
When running without opcache, static_members_table is shared with
default_static_members_table. This is visible in reflection output,
because ReflectionProperty::getDefaultValue() will return the
current value, rather than the default value.

Address this by never sharing the table, which matches the behavior
we already see under opcache.

Fixes bug #80821.

Closes GH-7299.
2021-07-23 09:29:32 +02:00
Máté Kocsis 87c181a0b0 Fix oci8.old_oci_close_semantics deprecation is always displayed 2021-07-22 16:21:46 +02:00
Dmitry Stogov e1f211f7bb Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed typo
2021-07-22 16:15:44 +03:00
Dmitry Stogov 8fbeebec34 Fixed typo 2021-07-22 16:14:26 +03:00
Dmitry Stogov 9c2b87c3cf JIT: avoid $this check in closures called from methods 2021-07-22 16:05:43 +03:00
Máté Kocsis fc56de113c Add support for generating readonly properties via stubs (#7297) 2021-07-22 11:09:10 +02:00
Nikita Popov 8a26cbe0dd Remove unnecessary PDORow get_method / get_class_name handlers
These implement the default behavior, but badly.
2021-07-22 10:40:10 +02:00
Nikita Popov a5ad9eeefa Add explicit IntlPartsIterator::getRuleStatus() method
Rather than doing a magic forward, explicitly add a forwarding
method. This must be the most frivolous use of get_method I've
ever seen.
2021-07-22 10:33:49 +02:00
Andy Postnikov bb9ef2bedb Backport libgd commit
Source - https://github.com/libgd/libgd/commit/f6a111c632fcf76dd3a42d750f18d2ed7bf8a5f1
Related to https://github.com/php/php-src/pull/5127#issuecomment-884032991
2021-07-22 09:57:41 +02:00
Nikita Popov 9e787d51b5 Fix typo
Did not have intl enabled in this build...
2021-07-22 09:47:45 +02:00
Nikita Popov 578b785ecf Don't return reference from Fiber::getReturn()
Even if the fiber function returns by reference, we must return
a value from Fiber::getReturn() to satisfy the function signature.

Fixes oss-fuzz #36417.
2021-07-22 09:44:19 +02:00
Nikita Popov 6d505d4445 Add RETURN/RETVAL_COPY_DEREF() macros
These were missing from the set...

I think quite a few of these usages don't actually need the DEREF,
but I've just kept things as is for now.
2021-07-22 09:44:19 +02:00
Máté Kocsis 23b1c4a982 Migrate to PHP-Parser 4.12.0 and regenerate some arginfos 2021-07-22 09:40:16 +02:00
Jakub Zelenka 590af4678b Sync the FPM openmetrics status with php-fpm_exporter 2021-07-21 19:58:36 +01:00
Joe Watkins bf294d51b4 Extend resource reservation to Fibers (#7292) 2021-07-21 20:19:20 +02:00
Dmitry Stogov 713eec75f2 Merge branch 'PHP-8.0'
* PHP-8.0:
  Added test
2021-07-21 19:43:00 +03:00