summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'PHP-7.4'Nikita Popov2019-10-251-3/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix bug #78226: Don't call __set() on uninitialized typed properties
| * | Fix bug #78226: Don't call __set() on uninitialized typed propertiesNikita Popov2019-10-251-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assigning to an uninitialized typed property will no longer trigger a call to __set(). However, calls to __set() are still triggered if the property is explicitly unset(). This gives us both the behavior people generally expect, and still allows ORMs to do lazy initialization by unsetting properties. For PHP 8, we should fine a way to forbid unsetting of declared properties entirely, and provide a different way to achieve lazy initialization.
* | | Optimize instanceof_functionNikita Popov2019-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Split out the simple equality check into an inline function -- this is one of the common cases. Replace instanceof_function_ex with zend_class_implements_interface. There are a few more places where it may be used.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-10-101-0/+1
|\ \ \ | |/ /
| * | Fix leak when property AST evaluation failsNikita Popov2019-10-101-0/+1
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-10-081-0/+6
|\ \ \ | |/ /
| * | Handle "non well formed" exception during ZPPNikita Popov2019-10-081-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if the "non well formed" notice was converted into an exception we'd still end up executing the function. Also drop the now unnecessary EG(exception) checks in the engine. Additionally remote a bogus exception in zend_is_callable: It should only be writing to error, but not directly throwing.
* | | Convert "Illegal offset type" warnings to exceptionsNikita Popov2019-09-271-1/+1
| | |
* | | Add check_only parameter to get_closure handlerChristoph M. Becker2019-09-241-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `get_closure` handlers are called to check whether an object is callable, and to actually get the closure, respectively. The behavior of the handler might differ for these two cases, particularly the handler may throw in the latter case, but should not in the former. Therefore we add a `check_only` parameter, to be able to distinguish the desired purpose.
* | | Use ZEND_TYPE_IS_SET() when checking for property typesNikita Popov2019-09-231-4/+4
| | | | | | | | | | | | | | | Instead of a simple if or 0 comparison. This would no longer work if zend_type is a struct.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-09-191-1/+7
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78543: is_callable() on FFI\CData throws Exception
| * | Fix #78543: is_callable() on FFI\CData throws ExceptionChristoph M. Becker2019-09-191-5/+10
| | | | | | | | | | | | | | | If `Z_OBJ_HANDLER_P(callable, get_closure)` throws, we must not let the exeception pass to userland, if called through `is_callable()`.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-08-231-0/+9
|\ \ \ | |/ /
| * | Fix arginfo leak when using disabled_classesNikita Popov2019-08-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Also remove the hack where scope is set to NULL in order to make free_internal_arg_info work. Instead explicitly call it for class methods. This fixes the asan build for Zend/tests/bug77494.phpt.
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-07-221-0/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Initialize static_members_table
| * | Initialize static_members_tableDmitry Stogov2019-07-221-0/+6
| | |
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-07-081-3/+15
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Delay EG(exception) check on slow path
| * | Delay EG(exception) check on slow pathDmitry Stogov2019-07-081-6/+30
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-06-281-0/+1
|\ \ \ | |/ /
| * | Fix arginfo leak in disable_functionsNikita Popov2019-06-281-0/+1
| | | | | | | | | | | | Arginfo is allocated if types are used, we need to free it.
* | | Constify some char* arguments or return values of ZEND_APItwosee2019-06-121-3/+3
| | | | | | | | | | | | Closes GH-4247.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-06-111-1/+1
|\ \ \ | |/ /
| * | Support full variance if autoloading is usedNikita Popov2019-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep track of delayed variance obligations and check them after linking a class is otherwise finished. Obligations may either be unresolved method compatibility (because the necessecary classes aren't available yet) or open parent/interface dependencies. The latter occur because we allow the use of not fully linked classes as parents/interfaces now. An important aspect of the implementation is we do not require classes involved in variance checks to be fully linked in order for the class to be fully linked. Because the involved types do have to exist in the class table (as partially linked classes) and we do check these for correct variance, we have the guarantee that either those classes will successfully link lateron or generate an error, but there is no way to actually use them until that point and as such no possibility of violating the variance contract. This is important because it ensures that a class declaration always either errors or will produce an immediately usable class afterwards -- there are no cases where the finalization of the class declaration has to be delayed until a later time, as earlier variants of this patch did. Because variance checks deal with classes in various stages of linking, we need to use a special instanceof implementation that supports this, and also introduce finer-grained flags that tell us which parts have been linked already and which haven't. Class autoloading for variance checks is delayed into a separate stage after the class is otherwise linked and before delayed variance obligations are processed. This separation is needed to handle cases like A extends B extends C, where B is the autoload root, but C is required to check variance. This could end up loading C while the class structure of B is in an inconsistent state.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-06-051-4/+15
|\ \ \ | |/ /
| * | Allow exceptions in __toString()Nikita Popov2019-06-051-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
* | | Merge branch 'PHP-7.4'Joe Watkins2019-06-031-12/+0
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Revert "Fix bug #62397 - disable_functions does not work with eval."
| * | Revert "Fix bug #62397 - disable_functions does not work with eval."Joe Watkins2019-06-031-12/+0
| | | | | | | | | | | | This reverts commit 050d299364ded5cb7b878bc515aa763c9c623c4b.
* | | Add Z_PARAM_NUMBER and use it for some functionsNikita Popov2019-06-031-0/+30
| | |
* | | Remove zpp L specifierNikita Popov2019-06-031-46/+4
| | | | | | | | | | | | | | | We don't use this internally anymore, and external usages should be encouraged to move towards 'l'.
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-05-311-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Better hot/cold code splitting
| * | Better hot/cold code splittingDmitry Stogov2019-05-311-1/+1
| | |
* | | Remove get() object handlerNikita Popov2019-05-291-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | Now that set() is gone, there is little point in keeping get(), as it is essentially just a different way of writing cast_object() now. Closes GH-4202.
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-05-291-3/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Mark "cold" functions
| * | Mark "cold" functionsDmitry Stogov2019-05-291-3/+3
| | |
* | | Merge branch 'PHP-7.4'Joe Watkins2019-05-291-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.4: disabled functions must not have return type Restore the execute bit for run-tests.php
| * | Merge branch 'PHP-7.3' into PHP-7.4Joe Watkins2019-05-291-1/+1
| |\ \ | | |/ | | | | | | | | | | | | * PHP-7.3: disabled functions must not have return type Restore the execute bit for run-tests.php
| | * Merge branch 'PHP-7.2' into PHP-7.3Joe Watkins2019-05-291-1/+1
| | |\ | | | | | | | | | | | | | | | | * PHP-7.2: disabled functions must not have return type
| | | * disabled functions must not have return typeJoe Watkins2019-05-291-1/+1
| | | |
| | * | Fix more dl() interned string assertionsNikita Popov2019-04-181-8/+18
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-05-271-1/+1
|\ \ \ \ | |/ / /
| * | | Accept flags argument in zend_lookup_class_ex()Nikita Popov2019-05-271-1/+1
| | | | | | | | | | | | | | | | Instead of a single boolean, so we have space for extension here.
* | | | Merge branch 'PHP-7.4'Peter Kokot2019-05-151-0/+12
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | * PHP-7.4: Update changelogs Fix bug #62397 - disable_functions does not work with eval.
| * | | Fix bug #62397 - disable_functions does not work with eval.Benjamin Eberlei2019-05-141-0/+12
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-04-181-8/+18
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-04-181-8/+18
| |\ \ \
| | * | | Fix more dl() interned string assertionsNikita Popov2019-04-181-8/+18
| | |/ /
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-04-181-0/+1
|\ \ \ \ | |/ / /
| * | | Fix dl() module unloading in post deactivateNikita Popov2019-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | FOREACH_END_DEL() does not call the destructor by itself, we need to explicitly call it. Due to the missing dtor call the functions were not unregistered early, which resulted in later shutdown segfaults.
* | | | Merge branch 'PHP-7.4'Dmitry Stogov2019-04-171-4/+4
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning.
| * | | Merge branch 'PHP-7.3' into PHP-7.4Dmitry Stogov2019-04-171-4/+4
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.3: Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning.