summaryrefslogtreecommitdiff
path: root/Zend/zend_objects.c
Commit message (Collapse)AuthorAgeFilesLines
* Review the usage of apostrophes in error messagesMáté Kocsis2020-07-101-6/+10
| | | | Closes GH-5590
* Change GC_COLLECTABLE flag into GC_NOT_COLLECTABLE to simplify GC_MAY_LEAK() ↵Dmitry Stogov2020-06-151-1/+1
| | | | check
* Back up fake_scope in zend_call_functionNikita Popov2020-06-091-4/+0
| | | | | | We regularly find new places where we forgot to reset fake_scope. Instead of having to handle this for each caller of zend_call_function() and similar APIs, handle it directly in zend_call_function().
* Add zend_call_known_function() API familyNikita Popov2020-06-091-40/+2
| | | | | | | | | | | | | | | | | | | | | | | | This adds the following APIs: void zend_call_known_function( zend_function *fn, zend_object *object, zend_class_entry *called_scope, zval *retval_ptr, int param_count, zval *params); void zend_call_known_instance_method( zend_function *fn, zend_object *object, zval *retval_ptr, int param_count, zval *params); void zend_call_known_instance_method_with_0_params( zend_function *fn, zend_object *object, zval *retval_ptr); void zend_call_known_instance_method_with_1_params( zend_function *fn, zend_object *object, zval *retval_ptr, zval *param); void zend_call_known_instance_method_with_2_params( zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2); These are used to perform a call if you already have the zend_function you want to call. zend_call_known_function() is the base API, the rest are just really thin wrappers around it for the common case of instance method calls. Closes GH-5692.
* Merge branch 'PHP-7.4'Nikita Popov2019-10-251-1/+1
|\ | | | | | | | | * 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Use ZEND_TYPE_IS_SET() when checking for property typesNikita Popov2019-09-231-2/+2
| | | | | | | | | | Instead of a simple if or 0 comparison. This would no longer work if zend_type is a struct.
* | Merge branch 'PHP-7.4'Nikita Popov2019-08-131-1/+2
|\ \ | |/
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-08-131-1/+2
| |\
| | * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-08-131-1/+2
| | |\
| | | * Don't destroy properties array with unset GC typeNikita Popov2019-08-131-1/+2
| | | | | | | | | | | | | | | | | | | | As the properties array can also be a GC root, it might have already been destroyed.
| | | * year++Xinchen Hui2018-01-021-1/+1
| | | |
| | * | Future-proof email addressesZeev Suraski2018-11-011-3/+3
| | | |
* | | | Merge branch 'PHP-7.4'Joe Watkins2019-03-121-0/+6
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: zend_weakrefs
| * | | zend_weakrefsJoe Watkins2019-03-121-0/+6
| | | |
* | | | Refactor zend_object_handlers API to pass zend_object* and zend_string* ↵Dmitry Stogov2019-02-041-3/+1
|/ / / | | | | | | | | | insted of zval(s).
* | | Remove local variablesPeter Kokot2019-02-031-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | | Adios, yearly copyright rangesZeev Suraski2019-01-301-1/+1
| | |
* | | Implement typed propertiesNikita Popov2019-01-111-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/typed_properties_v2 This is a squash of PR #3734, which is a squash of PR #3313. Co-authored-by: Bob Weinand <bobwei9@hotmail.com> Co-authored-by: Joe Watkins <krakjoe@php.net> Co-authored-by: Dmitry Stogov <dmitry@zend.com>
* | | Update email addresses. We're still @Zend, but future proofing it...Zeev Suraski2018-11-011-3/+3
| | |
* | | Inlining in the most frequently used code pathsDmitry Stogov2018-10-231-2/+7
| | |
* | | Remove unused ZEND_FILE_LINE in i_zval_ptr_dtorNikita Popov2018-09-161-2/+2
|/ /
* | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | se zval_ptr_dtor_str() instead of zend_string_release_ex(Z_STR(*), 0)Dmitry Stogov2018-07-041-1/+1
| |
* | Reduced overhead of magic method calls ↵Dmitry Stogov2018-06-221-9/+44
| | | | | | | | (__get/__set/__unset/__isset/__dectructor/__clone).
* | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-1/+1
| | | | | | | | where we sure about string persistence.
* | Optimize zend_hash_real_init()Dmitry Stogov2018-03-231-1/+1
| |
* | Get rid of IS_OBJ_USE_GUARDS and IS_OBJ_HAS_GUARDS flagsDmitry Stogov2018-02-271-4/+2
| |
* | Use OBJ_FLAGS() macro to access object flags (even if they are currently ↵Dmitry Stogov2018-01-221-2/+2
| | | | | | | | stored together with GC_FLAGS)
* | Use HT_FLAGS() macroDmitry Stogov2018-01-221-2/+2
| |
* | year++Xinchen Hui2018-01-021-1/+1
| |
* | Use fastcall calling convention for objects and resources APIDmitry Stogov2017-12-141-3/+3
| |
* | Encapsulate reference-counting primitives.Dmitry Stogov2017-10-271-4/+4
| | | | | | | | | | | | Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead. Added mactros to validate reference-counting (disabled for now). These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
* | Refactored array creation API. array_init() and array_init_size() are ↵Dmitry Stogov2017-09-201-2/+1
|/ | | | converted into macros calling zend_new_array(). They are not functions anymore and don't return any values.
* further sync for vim mode linesAnatol Belski2017-07-041-0/+2
|
* Cleanup. Removed unused functions and unimplemented prototype. Avoid useless ↵Dmitry Stogov2017-06-271-1/+1
| | | | "dtor_obj" calls.
* Unused varXinchen Hui2017-05-081-2/+0
|
* Don't double initialize object propertiesNikita Popov2017-05-041-9/+11
|
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* Turn IS_TYPE_COLLECTABLE zval flag into GC_COLLECTABLE zend_refcounted flag.Dmitry Stogov2016-10-211-1/+1
| | | | This simplifies checks and allows reset this flag for "acyclic" arrays and objects.
* EG(fake_scope) was always set to NULL wronglyXinchen Hui2016-06-121-7/+4
|
* Fixed bug #72177 (Scope issue in __destruct after ↵Dmitry Stogov2016-05-131-0/+7
| | | | ReflectionProperty::setValue())
* - get rid of EG(scope). zend_get_executed_scope() should be used instead.Dmitry Stogov2016-04-281-20/+20
| | | | - ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
* Optimize property guards for the most usual case with only one acive guard.Dmitry Stogov2016-04-271-5/+10
|
* IS_CONST operands don't have to be separated. Use reference-counting instead ↵Dmitry Stogov2016-04-051-1/+1
| | | | | | | of duplication. - with opcache all IS_CONST operands are not refcounted (scalars, interned strings or immutable arrays) - without opcache IS_CONST operands are not shared between processes or threads and may use common reference counters
* bump year which is missed in rev 49493a2Xinchen Hui2016-01-021-1/+1
|
* Add myself into list of authors of the most refactored files.Dmitry Stogov2015-08-311-0/+1
|
* Fixed bug #70187 (Notice: unserialize(): Unexpected end of serialized data)Dmitry Stogov2015-08-261-0/+3
|
* Use NULL where possible for exception classAaron Piotrowski2015-07-071-2/+2
| | | | Matches usage of zend_throw_exception()/zend_throw_exception_ex().
* Remove need to pass error levelAaron Piotrowski2015-07-031-10/+22
|