Commit Graph

2250 Commits

Author SHA1 Message Date
Nikita Popov
bd2a00acdf Merge branch 'PHP-7.2' into PHP-7.3 2019-02-22 10:13:21 +01:00
Nikita Popov
5388143855 Fixed bug #77652 2019-02-22 10:11:54 +01:00
Nikita Popov
14684af0d0 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-29 09:40:06 +01:00
Nikita Popov
34898e9766 Make special assert() handling independent of compiler flags 2019-01-29 09:39:12 +01:00
Nikita Popov
ab3c94a54f Merge branch 'PHP-7.2' into PHP-7.3 2019-01-28 09:23:23 +01:00
ekinhbayar
ef68cd3249 Fixed bug #77530: PHP crashes when parsing "(2)::class" 2019-01-28 09:22:18 +01:00
Nikita Popov
e0f97ae7ec Merge branch 'PHP-7.2' into PHP-7.3 2019-01-24 10:57:45 +01:00
Nikita Popov
526344aa5e Add flag to disable jumptable optimization
This is useful for coverage. While it is currently safe to just
skip over the SWITCH_* opcodes, this may not be true in the future
due to opcache optimizations, so it's safer to disable emission of
SWITCH_* opcodes entirely.
2019-01-24 10:56:04 +01:00
Nikita Popov
1ed20669c5 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-04 09:53:30 +01:00
Nikita Popov
41af1e6781 Fix self::class inside constant in global scope
Previously this triggered an assertion failure. The behavior is
not quite correct, in that self::class should generate an exception
if there is no self, but returns an empty string here. Fixing that
would be a bit too intrusive for the 7.2 branch.
2019-01-04 09:52:04 +01:00
Nikita Popov
613683580b Merge branch 'PHP-7.2' into PHP-7.3 2019-01-02 11:34:15 +01:00
Nikita Popov
73596c56e7 Partial fix for bug #75426
This does not print the exact line of the comma, but rather the line
of the previous element. This should generally be "good enough", as
the line number is close (off by one) to the actual issue now.
Previously it would point to the start of the array, which may be
very far away.
2019-01-02 11:32:48 +01:00
Dmitry Stogov
ddfb44f2cf Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77339 (__callStatic may get incorrect arguments)
2018-12-24 13:23:47 +03:00
Dmitry Stogov
7e597f48e9 Fixed bug #77339 (__callStatic may get incorrect arguments) 2018-12-24 13:22:43 +03:00
Nikita Popov
93aabf1533 Fixed bug #77275
Instead of juggling with this problem during literal compaction,
make sure that we always initialize Z_EXTRA for literals, which
seems like the more robust solution.
2018-12-10 13:36:23 +01:00
Nikita Popov
12e88781e1 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-27 19:44:45 +01:00
Nikita Popov
b565c85b9e Improve fix for #76046
Also locate the JMP at the start of the foreach.

Patch suggested by Derick.
2018-11-27 19:43:25 +01:00
Nikita Popov
d78211aec0 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-27 16:39:21 +01:00
Nikita Popov
d6595f276f Fixed bug #76046
Place FE_FREE on start line of foreach, instead of whatever random
line number might be in CG(zend_lineno) at the time.
2018-11-27 16:37:55 +01:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Nikita Popov
8b8b625d08 Fixed bug #72635
This seems to be a simple oversight, where we did not enable
exceptions. Other constexpr conditions already throw, so there is
no particular reason to stick to a fatal error here.
2018-09-29 14:21:08 +02:00
Dmitry Stogov
b8828926f2 Avoid hash lookups in BIND_STATIC and BIND_LEXICAL opcode handlers.
Encode static variable offset into opline->extended_value.
2018-08-20 16:10:09 +03:00
Dmitry Stogov
3ced766da9 Removed duplicate code. zend_fetch_dimension_address_LIST_w() was a copy of zend_fetch_dimension_address_W(), ZEND_FETCH_LIST_W_SPEC_CV_... a copy of ZEND_FETCH_DIM_W_SPEC_CV_... 2018-07-30 10:53:39 +03:00
Dmitry Stogov
ab8094c666 Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value. 2018-07-26 12:58:07 +03:00
Dmitry Stogov
f950128cd6 Encode parent class name as IS_CONST operand in DECLARE_INHERITED_CLASS and DECLARE_ANON_INHERITED_CLASS opcodes (eliminate FETCH_CLAS
S opcode).
2018-07-25 13:40:47 +03: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
Nikita Popov
5c4047b339 Deprecate defining a free-standing assert() function
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:34:09 +02:00
Dmitry Stogov
5e8977bd62 Merge zend_class_entry.create_object and zend_class_entry.interface_gets_implemented into the same memory lacation. The first used only by classes, the second only by magic interfaces. 2018-07-12 17:09:40 +03:00
Dmitry Stogov
7d4e18b05d Improved user iterator implementation to reduce zend_class_entry memory consumption and avoid race condition during resolving/caching of user iterator functions of internal classes in ZTS build. 2018-07-12 14:04:14 +03:00
Dmitry Stogov
85ee47eda0 Changed structure of zend_class_entry.trait_aliases and zend_class_entry.trait_precedences to avoid keeping "intermediate" trait references, that are used only during inheritance. 2018-07-11 18:56:10 +03:00
Nikita Popov
04e3523b7d Warn if continue is used on switch
Supersedes RFC https://wiki.php.net/rfc/continue_on_switch_deprecation
by generating a warning instead of deprecating and removing this
functionality.
2018-07-07 11:12:48 +02:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Kalle Sommer Nielsen
c49f0fd9ac Fixed bug #76501 (Funny message with fatal error) 2018-07-04 03:04:31 +02:00
Dmitry Stogov
28b03f9605 Another fix for bug #63217 2018-07-03 01:09:58 +03:00
Dmitry Stogov
57af94c8b9 Partial revert of 30156d588c 2018-07-02 20:54:44 +03:00
Rudi Theunissen
30156d588c Fixed bug #63217
Don't automatically convert literal string keys to integers on
array access, as we may be dealing with an ArrayAccess object,
rather than a plain array.
2018-07-02 16:41:59 +02:00
Dmitry Stogov
43aca3118a Avoid string comparisons for magic methods (all magic methods start with "__") 2018-07-02 17:03:02 +03:00
Dmitry Stogov
1b80de93b8 Cleanup conditions 2018-06-26 16:18:30 +03:00
Dmitry Stogov
8c22d3e729 Make FETCH_R/IS, FETCH_DIM_R/IS, FETCH_OBJ_R/IS, FETCH_STATIC_PROP_R/IS return TMP_VAR, instead of VAR. 2018-06-25 23:43:23 +03:00
Dmitry Stogov
7f67513ca3 Lazy function copying from op_cache SHM into process memory 2018-06-25 19:53:58 +03:00
Nikita Popov
d04917c7b3 Fixed bug #75218
I've introduced a new CompileError type, from which ParseError
inherits. These errors are not parse errors in the narrow sense
of the term, even though they happen to be generated during
parsing in our implementation. Additionally reusing the ParseError
class for this purpose would change existing error messages (if
the exception is not caught) from a "Fatal error:" to a "Parse
error:" prefix, and also the error kind from E_COMPILE_ERROR to
E_PARSE.
2018-06-16 12:41:03 +02:00
Dmitry Stogov
9e0f131d2b Fixed ISSET/ISEMPTY bit meaning to simplify run-time checks 2018-05-31 19:02:51 +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
524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Dmitry Stogov
83f98f7340 Don't store values of PHP_SAPI and PHP_BINARY in file cache, because it may be used by different SAPI. 2018-04-28 01:20:49 +03:00
Levi Morrison
0c80cb164f Fix bug #76198 2018-04-14 13:07:44 +02:00
Dmitry Stogov
eb39d8d686 Use cheaper functions 2018-03-15 12:46:19 +03:00
Dmitry Stogov
8afb91cdad PHP scanner optimization 2018-03-14 01:48:17 +03:00
Dmitry Stogov
d1585a9e3f Revert "Handle scanner error in first place (don't hide them from ext/tokenizer) and cheaper whitespace handlig."
This reverts commit 0d6da03f5c.
2018-03-14 01:08:03 +03:00