Commit Graph

201 Commits

Author SHA1 Message Date
Nikita Popov
bd3e536383 Fixed bug #81514
Objects reuse the GC_PERSISTENT flag as IS_OBJ_WEAKLY_REFERENCED,
which we did not account for in ZVAL_COPY_OR_DUP. To make things
worse the incorrect zval_copy_ctor_func() invocation silently did
nothing. To avoid that, add an assertion that it should only be
called with arrays and strings (unlike the normal zval_copy_ctor()
which can be safely called on any zval).
2021-10-08 10:31:24 +02:00
Peter Kokot
92ac598aab Remove local variables
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.
2019-02-03 21:03:00 +01:00
Zeev Suraski
a81202ac49 Adios, yearly copyright ranges 2019-01-30 11:48:28 +01:00
Nikita Popov
e219ec144e Implement typed properties
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>
2019-01-11 15:49:06 +01:00
Dmitry Stogov
617c90bcb9 Eliminate zend_string_destroy() wrapper in release build 2018-12-28 15:25:57 +03:00
Zeev Suraski
54dc07f3dc Update email addresses. We're still @Zend, but future proofing it... 2018-11-01 17:20:07 +02:00
Nikita Popov
d51b9a690e Remove unnecessary destroy wrappers
There used to be needed due to ZEND_FILE_LINE in debug builds.
As the argument is no longer passed, we don't need the wrappers
either.
2018-09-16 17:16:26 +02:00
Nikita Popov
dfa166e7ed Remove unused ZEND_FILE_LINE in i_zval_ptr_dtor 2018-09-16 17:16:26 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
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.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
ebd1f5af3e API cleanup.
Removed useless filename and lineno arguments, used in DEBUG build.
The patch doesn't break source compatibility of public API (only binary compatibility).
2018-07-23 15:24:07 +03:00
Xinchen Hui
9d1e9b73c5 rename ref_dtor_func to rc_dtor_func 2018-07-06 19:15:26 +08:00
Xinchen Hui
f9297387f4 Rename zval_dtor_func and ref_dotr_func 2018-07-06 18:47:30 +08:00
Xinchen Hui
e3355ac5ec Revert "Rename _zval_dtor_func to _ref_dtor_func"
This reverts commit a362ae6b12.
2018-07-06 18:37:45 +08:00
Xinchen Hui
a362ae6b12 Rename _zval_dtor_func to _ref_dtor_func 2018-07-06 18:32:27 +08:00
Dmitry Stogov
7eb045d31a API cleanup. Removed unused functions (kept compatibility macros). 2018-07-04 00:50:57 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Dmitry Stogov
925f05dd1a Added missing debug arguments 2018-05-28 13:09:33 +03:00
Dmitry Stogov
1e783db679 Put ZEND_FASTCALL into the proper place. 2018-01-16 09:44:10 +03:00
Dmitry Stogov
022e029984 Optimize zval_dtor_func() 2018-01-16 00:57:47 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
dd1050fa6c Improved branch prediction and code locality 2017-12-14 02:22:07 +03:00
Dmitry Stogov
747a5928ad Added assertion 2017-12-07 15:01:23 +03:00
Dmitry Stogov
d3fa900780 Removed workaraouns for inconsistent zvals (REFCOUNTED+INTERNED). They should be fixed now. 2017-11-03 21:02:55 +03:00
Dmitry Stogov
990d8092a4 Reverted incomplete fix and too strict asserts. 2017-11-01 16:18:13 +03:00
Dmitry Stogov
b84cbefa94 Change checks that should be always true into ZEND_ASSERT() (some edge cases may be trapped here). 2017-10-31 15:41:51 +03:00
Dmitry Stogov
97e7521e49 AST don't have to be COPYABLE anymore. 2017-10-10 15:45:03 +03:00
Dmitry Stogov
ef5ea48741 Always use IS_CONSTANT_AST (IS_CONSTANT is removed). 2017-10-10 10:11:05 +03:00
Dmitry Stogov
39ded1d5f8 Changed zend_ast_ref structure to use only one allocation, removing dichotomy between heap/arena ASTs. 2017-10-09 16:57:51 +03:00
Dmitry Stogov
c24b3eff11 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Properly update string type flags
2017-09-13 01:46:12 +03:00
Dmitry Stogov
d7a10f0e32 Properly update string type flags 2017-09-13 01:45:57 +03:00
Dmitry Stogov
5f1d553e7e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Revert "Properly update string type flags"
2017-09-13 00:15:08 +03:00
Dmitry Stogov
83d8ebc991 Revert "Properly update string type flags"
This reverts commit 99b1a62d55.
2017-09-13 00:14:39 +03:00
Dmitry Stogov
7452fd0263 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Properly update string type flags
2017-09-12 23:43:42 +03:00
Dmitry Stogov
99b1a62d55 Properly update string type flags 2017-09-12 23:42:51 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Nikita Popov
896814e139 Make zval_ptr_dtor / _zval_dtor_func more robust
In particular, allow arrays with refcount>1, like we already allow
for all other types. _zval_dtor_func is now the same as
_zval_dtor_func_for_ptr with an extra refcount decrement check at
the start. At this point we might as well drop it...

Cherry-pick of ded69ee6e6 from
PHP-7.1.
2016-09-17 22:33:41 +02:00
Dmitry Stogov
cca2c8ecc4 Reimplemented Bob's commit bac6fdb0c5 without insignificant renaming and white-space changes 2016-05-06 10:47:58 +03:00
Dmitry Stogov
c19cb70dac Revert "Refactor zval cleanup into single function"
This reverts commit bac6fdb0c5.
2016-05-06 10:47:58 +03:00
Bob Weinand
bac6fdb0c5 Refactor zval cleanup into single function
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
2016-05-05 23:31:57 +02:00
Nikita Popov
01df044fd5 Reset IMMUTABLE flag when copy_ctor'ing AST 2016-04-29 22:39:21 +02:00
Nikita Popov
ded69ee6e6 Make zval_ptr_dtor / _zval_dtor_func more robust
In particular, allow arrays with refcount>1, like we already allow
for all other types. _zval_dtor_func is now the same as
_zval_dtor_func_for_ptr with an extra refcount decrement check at
the start. At this point we might as well drop it...
2016-04-22 17:48:35 +02:00
Xinchen Hui
563659822d Merge branch 'PHP-7.0' 2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Nikita Popov
65e456f364 Introduce BIND_LEXICAL
This opcodes inserts a local CV into the closure static variable
table. This replaces the previous mechanism of having static
variables marked as LEXICAL, which perform a symtable lookup
during copying.

This means a) functions which contain closures no longer have to
rebuild their symtable (better performance) and b) we can now track
used variables in SSA.
2015-12-29 23:14:53 +01:00
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Xinchen Hui
72b0627315 Fixed bug #69521 (Segfault in gc_collect_cycles()). 2015-07-02 18:43:06 +08:00
Dmitry Stogov
7aa7627172 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 13:59:27 +03:00
Dmitry Stogov
276080ec3a Added GC checks and improvements 2015-04-17 03:55:37 +03:00
Dmitry Stogov
acfc31c0f8 Use zend_error_noreturn() for fatal errors 2015-04-01 13:32:23 +03:00