summaryrefslogtreecommitdiff
path: root/Zend/zend_weakrefs.c
Commit message (Collapse)AuthorAgeFilesLines
* Generate zend class entries based on stubsMáté Kocsis2021-02-141-10/+2
| | | | Closes GH-6685
* Replace zend_bool uses with boolNikita Popov2021-01-151-1/+1
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Use Z_PARAM_OBJ macros when zval isn't neededTyson Andre2021-01-021-6/+6
| | | | | | | | | | In some cases, like spl_object_id, the code is simpler but equally efficient after optimizations. In other cases, like get_mangled_object_vars(), the compiler can't infer that the object in the zval won't change. Closes GH-6567
* Flesh out HashTable insertion APIsSara Golemon2020-12-011-3/+3
| | | | | | | | | | | | | | | | Fills out the array/object-property insert helpers for zend_array, zend_object, and zend_reference. This adds the following matrix of 18 APIs add_next_index_T() add_index_T() add_assoc_T() add_assoc_T_ex() add_property_T() add_property_T_ex() Where T in array, object, reference Converted internal callsites currently doing an explicit object wrap.
* Improve type declarations for Zend APIsGeorge Peter Banyard2020-08-281-0/+2
| | | | | | | | | Voidification of Zend API which always succeeded Use bool argument types instead of int for boolean arguments Use bool return type for functions which return true/false (1/0) Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics Closes GH-6002
* Allow removing non-existing key from WeakMapNikita Popov2020-08-271-0/+5
| | | | | In line with usual PHP semantics. This previously triggered an assertion failure.
* Fix use-after-free is WeakMap key and value are the sameNikita Popov2020-08-271-3/+7
| | | | | Drop the object from the WeakMap as the last step, as this might end up destroying the object.
* Fix warnings of strict-prototypestwosee2020-07-231-2/+2
| | | | Closes GH-5887.
* Review the usage of apostrophes in error messagesMáté Kocsis2020-07-101-3/+1
| | | | Closes GH-5590
* Add get_gc handle for object iteratorsNikita Popov2020-07-011-1/+2
| | | | Optional handler with the same semantics as the object handler.
* Introduce InternalIteratorNikita Popov2020-06-241-4/+11
| | | | | | | | | | | | | | | | | | | Userland classes that implement Traversable must do so either through Iterator or IteratorAggregate. The same requirement does not exist for internal classes: They can implement the internal get_iterator mechanism, without exposing either the Iterator or IteratorAggregate APIs. This makes them usable in get_iterator(), but incompatible with any Iterator based APIs. A lot of internal classes do this, because exposing the userland APIs is simply a lot of work. This patch alleviates this issue by providing a generic InternalIterator class, which acts as an adapater between get_iterator and Iterator, and can be easily used by many internal classes. At the same time, we extend the requirement that Traversable implies Iterator or IteratorAggregate to internal classes as well. Closes GH-5216.
* Add flag to forbid dynamic property creation on internal classesNikita Popov2020-06-241-45/+2
| | | | | | | | | | | | | | | | | | | While performing resource -> object migrations, we're adding defensive classes that are final, non-serializable and non-clonable (unless they are, of course). This path adds a ZEND_ACC_NO_DYNAMIC_PROPERTIES flag, that also forbids the creation of dynamic properties on these objects. This is a subset of #3931 and targeted at internal usage only (though may be extended to userland at some point in the future). It's already possible to achieve this (what the removed WeakRef/WeakMap code does), but there's some caveats: First, this simple approach is only possible if the class has no declared properties, otherwise it's necessary to special-case those properties. Second, it's easy to make it overly strict, e.g. by forbidding isset($obj->prop) as well. And finally, it requires a lot of boilerplate code for each class. Closes GH-5572.
* Add ZVAL_OBJ_COPY macroNikita Popov2020-06-171-8/+4
| | | | | For the common ZVAL_OBJ + GC_ADDREF pattern. This mirrors the existing ZVAL_STR_COPY API.
* Generate method entries from stubs for Zend classesMáté Kocsis2020-04-261-18/+2
| | | | Closes GH-5459
* Implement WeakMapNikita Popov2020-01-031-25/+507
| | | | RFC: https://wiki.php.net/rfc/weak_maps
* Add missing ZPP checksMáté Kocsis2019-11-011-3/+2
| | | | Closes GH-4878.
* Add stubs for WeakReferenceNikita Popov2019-10-311-10/+4
|
* Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | Closes GH-4732.
* Merge branch 'PHP-7.4'Dmitry Stogov2019-05-311-5/+5
|\ | | | | | | | | * PHP-7.4: Better hot/cold code splitting
| * Better hot/cold code splittingDmitry Stogov2019-05-311-5/+5
| |
* | Fix weakref object handlers for masterNikita Popov2019-03-141-5/+5
|/
* zend_weakrefsJoe Watkins2019-03-121-0/+213