summaryrefslogtreecommitdiff
path: root/Zend
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary property unmangling in trait bindingNikita Popov2021-03-261-18/+2
| | | | | The unmangled name is already available as the hashtable key, use it directly.
* Improved type inference for FE_FETCH_RDmitry Stogov2021-03-251-2/+11
|
* Drop unneessary if branch and adjust arg_num typeGeorge Peter Banyard2021-03-252-8/+2
| | | | This if branch seems to be a remain of when certain type errors where E_WARNINGs, something which isn't the case since PHP 8.0.
* Revert "Use better function"Nikita Popov2021-03-221-1/+1
| | | | | | | This reverts commit 9162116a854fe37ce2c07a75b5ef7d797acba0ee. This causes many "__HALT_COMPILER(); must be declared in a phar" errors in phar tests on windows.
* Fix const warningNikita Popov2021-03-221-1/+1
|
* Support VERIFY_RETURN_TYPE elision with unused operandNikita Popov2021-03-221-5/+5
| | | | | | | | | | This handles the degenerate case where SCCP replaced the value in the RETURN opcode with a constant, but the VERIFY_RETURN is still there. We can still apply the same optimization, just don't need to adjust the use list in this case. The result is still sub-optimal in that a dead QM_ASSIGN is left behind.
* Use better functionDmitry Stogov2021-03-221-1/+1
|
* Add zend_hash_lookup() and zend_hash_index_lookup() functions.Dmitry Stogov2021-03-193-44/+96
| | | | Thet search for an element with given key/index and add an empty one (NULL), if no found.
* Fix handling of unknown class in trait precedence listNikita Popov2021-03-192-1/+16
| | | | Fixes oss-fuzz #31983.
* micro-optimizationDmitry Stogov2021-03-191-19/+9
|
* Support prototypes in call graphNikita Popov2021-03-198-38/+53
| | | | | | | | | | Even if we don't know the exact method being called, include it in the call graph with the is_prototype flag. In particular, we can still make use of return types from prototype methods, as PHP 8 makes LSP violations a hard error. Most other places are adjusted to skip calls with !is_prototype. Maybe some of them would be fine, but ignoring them is conservative.
* Add missing rc1/rcn to return type initializationNikita Popov2021-03-191-1/+2
|
* Allow inferring narrowed return typeNikita Popov2021-03-181-1/+12
| | | | | | Even if an explicit return type is given, we might still infer a more narrow one based on return statements. We shouldn't pessimize this just because a type has been declared.
* Update opt testNikita Popov2021-03-181-1/+1
| | | | And fix a type in the fetch class flags dumping while here.
* Don't imply SILENT from NO_AUTOLOADNikita Popov2021-03-185-20/+17
| | | | | | We have separate flags for non-autoloading class fetches and silent class fetches. There's no reason why NO_AUTOLOAD should be special-cased to be implicitly silent.
* Destroy constant values before object storeNikita Popov2021-03-182-19/+30
| | | | | | | | Now that constants can contain objects (currently only enums), we should destroy them before we free the object store, otherwise there will be false positive leak reports. This doesn't affect the fast_shutdown sequence.
* Implement enumsIlija Tovilo2021-03-17131-18/+3211
| | | | | | | | RFC: https://wiki.php.net/rfc/enumerations Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6489.
* Use zend_string_equals() API instead of strcmp() in various placesGeorge Peter Banyard2021-03-171-1/+1
| | | | Closes GH-6784
* Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-1613-73/+92
| | | | | This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS.
* Don't check executabilityNikita Popov2021-03-161-2/+2
| | | | | As $(PHP) is not an absolute path, test -x doesn't do anything meaningful. Rely on the autoconf check.
* Check for WRONG_PROPERTY_INFONikita Popov2021-03-161-1/+1
|
* Revert "Remove some unnecessary explicit header dependencies"Nikita Popov2021-03-161-0/+7
| | | | | | | This reverts commit c386b1fb177ec0dccc840cbec801e69609ced5c3. It looks like at least some of these might be needed for ordering in a clean build?
* Automatically run zend_vm_gen.php if zend_vm_def.h changesNikita Popov2021-03-161-0/+5
|
* Remove some unnecessary explicit header dependenciesNikita Popov2021-03-161-7/+0
| | | | These are now automatically tracked by the build system.
* Merge branch 'PHP-8.0'Nikita Popov2021-03-161-4/+3
|\ | | | | | | | | * PHP-8.0: Fix refcount inference for typed properties
* | Add sanity check for type of read_property return valueNikita Popov2021-03-163-0/+74
| | | | | | | | | | | | If an internal class overrides read_property and declared property types, make sure that the returned value matches the declared type (in debug builds).
* | Remove deprecated codeDmitry Stogov2021-03-131-6/+0
| |
* | Fixed compilation warningDmitry Stogov2021-03-121-0/+1
| |
* | Inline "array" part of FE_FETCH_R handler into HYBRID VMDmitry Stogov2021-03-112-207/+267
| |
* | zend_verify_recv_arg_type_helper is not "cold".Dmitry Stogov2021-03-112-2/+2
| |
* | Avoid repeatable work when error_reporting() is called with the same ↵Dmitry Stogov2021-03-111-1/+1
| | | | | | | | argument few times.
* | Inheritance cache optimizationDmitry Stogov2021-03-111-28/+34
| |
* | Merge branch 'PHP-8.0'Máté Kocsis2021-03-062-2/+2
|\ \ | |/
| * Fix the error message of attribute flag validationMáté Kocsis2021-03-062-2/+2
| |
* | Add const to zend_extension_version_info.build_idLevi Morrison2021-03-021-1/+1
| | | | | | | | | | | | | | This is a follow-up to: https://github.com/php/php-src/commit/3c6ab4b3ea5854fd44a2945bb65bf027a6c94890 Closes GH-6744.
* | Optimized object conversion to array without rebulding properties HashTableDmitry Stogov2021-03-015-0/+66
| |
* | Merge branch 'PHP-8.0'Nikita Popov2021-03-012-0/+22
|\ \ | |/ | | | | | | * PHP-8.0: Fixed bug #80811
| * Fixed bug #80811Nikita Popov2021-03-012-0/+22
| | | | | | | | | | When filling in defaults for skipped params, make sure that reference parameters get the expected reference wrapper.
* | Merge branch 'PHP-8.0'Nikita Popov2021-03-012-1/+16
|\ \ | |/ | | | | | | * PHP-8.0: Always remove HT iterators, even for uninit HT
| * Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-03-012-1/+16
| |\ | | | | | | | | | | | | * PHP-7.4: Always remove HT iterators, even for uninit HT
| | * Always remove HT iterators, even for uninit HTNikita Popov2021-03-012-1/+16
| | | | | | | | | | | | Fixes oss-fuzz #31423.
* | | Change the order of properties used in foreach(), var_dump(), serialize(), ↵Dmitry Stogov2021-03-017-52/+40
|\ \ \ | | | | | | | | | | | | comparison, etc. Now properties are ordered according to their layout in zend_object structure.
| * | | Change the order of properties used for var_dump(), serialize(), comparison, ↵Dmitry Stogov2021-03-017-52/+40
| | | | | | | | | | | | | | | | | | | | | | | | etc. Now properties are ordered according to their layout in zend_object structure.
* | | | Reference dynamic functions through dynamic_defsNikita Popov2021-03-0114-103/+162
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Fix E_DEPRECATED in zend_vm_gen.phpMax Semenik2021-03-011-3/+4
| | | | | | | | | | | | | | | | | | | | | explode(): Passing null to parameter #2 ($string) of type string is deprecated Closes GH-6698.
* | | Speed up __sleep() and __wakeup() callsDmitry Stogov2021-02-251-0/+2
| | |
* | | Switch few functions useful in Symphony apps to new ZPP API.Dmitry Stogov2021-02-242-18/+20
| | |
* | | Fixed error messageDmitry Stogov2021-02-245-6/+22
| | |
* | | zend_compile.c: fix typoDylan T2021-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Don't mind me, I just happened to be browsing this code. 🙃 Closes GH-6721. [ci skip]
* | | Generate class entries from stubs for com, standard, xmlreader, xmlwriter, ↵Máté Kocsis2021-02-223-5/+21
| | | | | | | | | | | | | | | | | | xsl, zip, Zend Closes GH-6706