1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 00:48:25 +02:00
Commit Graph

1086 Commits

Author SHA1 Message Date
Dmitry Stogov da919a8b65 Remove copyright years. 2019-02-05 10:33:28 +03: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
Joe Watkins ed1afdd617 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Properly check for array_replace_recursive in sccp.c
2019-02-03 08:42:07 +01:00
Joe Watkins e1c93d1fb2 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Properly check for array_replace_recursive in sccp.c
2019-02-03 08:41:26 +01:00
Tyson Andre cf56832d00 Properly check for array_replace_recursive in sccp.c
Due to a typo, this code used to check for array_merge_recursive
twice.
2019-02-03 08:40:21 +01:00
Dmitry Stogov 0ff71aead1 Fixed crash 2019-01-25 11:53:31 +03:00
Dmitry Stogov 4887896e21 Fixed crash 2019-01-24 18:00:45 +03:00
Nikita Popov d3e5a2487f Merge branch 'PHP-7.3' 2019-01-22 12:28:44 +01:00
Nikita Popov 76760901fa Fixed bug #77287
There may be an EXT_NOP opcode before the parameter list, we should
skip over it.
2019-01-22 12:15:06 +01:00
Nikita Popov a50198d0fe Implement ??= operator
RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator

$a ??= $b is $a ?? ($a = $b), with the difference that $a is only
evaluated once, to the degree that this is possible. In particular
in $a[foo()] ?? $b function foo() is only ever called once.
However, the variable access themselves will be reevaluated.
2019-01-22 11:12:04 +01:00
Dmitry Stogov 8cb1ae92e6 Use SSA instead of bogus reverse linear scan. 2019-01-22 01:33:35 +03:00
Dmitry Stogov 6c983c6221 Use ZEND_FUNC_FREE_LOOP_VAR flag to avoid useless iterations. 2019-01-21 22:18:07 +03:00
Dmitry Stogov abd0651020 Avoid double live ranges recalculation. 2019-01-21 18:17:10 +03:00
Dmitry Stogov 97ccafd4c6 Live ranges construction optimization 2019-01-21 17:25:24 +03:00
Nikita Popov 3269e88468 Implement single-pass live range calculation
Instead of interleaving creation of live-ranges with the main
compiler code, compute them in a separate pass over the opcodes
as part of pass_two. Additionally, do not keep live ranges
synchronized during optimization in opcache and instead use the
same mechanism to recompute them after optimization.
2019-01-21 11:47:27 +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
Nikita Popov 61b0122698 Merge branch 'PHP-7.3' 2019-01-10 10:27:57 +01:00
Nikita Popov ade702a0d2 Fixed bug #77434
Mark arrays containing partial arrays as partial. This was already
done for the ADD_ARRAY_ELEMENT case, but not for ASSIGN_DIM.
2019-01-10 10:25:55 +01:00
Xinchen Hui b1a4f90ea9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Incase of invalid read
2019-01-10 14:53:36 +08:00
Xinchen Hui 16176ad0e3 Incase of invalid read 2019-01-10 14:50:39 +08:00
Nikita Popov a22881520c Merge branch 'PHP-7.3' 2019-01-09 09:28:04 +01:00
Nikita Popov bf4dab0163 Make operator swapping depend on IGNORE_OVERLOADING flag
Add MUL back to the list and instead make the entire optimization
depend on IGNORE_OVERLOADING, which is there exactly so we can make
these kinds of assumptions.
2019-01-09 09:27:56 +01:00
Xinchen Hui dd61845cf8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77266 (Assertion failed in dce_live_ranges)
2019-01-08 19:19:44 +08:00
Xinchen Hui cd49db9d47 Fixed bug #77266 (Assertion failed in dce_live_ranges) 2019-01-08 19:19:01 +08:00
Nikita Popov c8a5deaddd Merge branch 'PHP-7.3' 2019-01-08 09:38:11 +01:00
Nikita Popov 7f8cab2535 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-08 09:38:02 +01:00
Nikita Popov 1165a9068c Don't swap operands of ZEND_MUL
If this is used with operator overloading, then the operation does
not necessarily commute (for example, matrix multiplication).
2019-01-08 09:37:49 +01:00
Nikita Popov 767cbd93c9 Merge branch 'PHP-7.3' 2019-01-07 10:05:33 +01:00
Nikita Popov 6f75890e7b Fix one issue reported in bug #77310
SCCP did not handle array ASSIGN_* with a BOT operand correctly.
2019-01-07 10:05:23 +01:00
Nikita Popov 31375c5ca3 Merge branch 'PHP-7.3' 2019-01-02 14:14:07 +01:00
Nikita Popov 325a113974 Possible fix for bug #77287
The cache size could be off by 4, if we're on a 32-bit system and
the slot had to be bumped for alignment reasons.

I wasn't able to reproduce the issue reported in bug #77287, but I
think this might be the cause.
2019-01-02 14:12:58 +01:00
Nikita Popov 685307b081 Merge branch 'PHP-7.3' 2019-01-02 09:32:59 +01:00
Nikita Popov 91888cc372 Fixed bug #77257
Correctly handle the case of duplicate predecessors, by removing the
duplicate predecessor and corresponding phi node operands.

For the future, it would be better to instead allow duplicate
predecessors and avoid this kind of fragile code...
2019-01-02 09:31:50 +01:00
Dmitry Stogov 9bf80ef385 Respect static method visibility 2018-12-27 10:42:52 +03:00
Nikita Popov 0bbfebb6d9 Add SCCP support for ZEND_ARRAY_KEY_EXISTS 2018-12-26 23:54:11 +03:00
Michael Moravec f5044a12dd Implement ZEND_ARRAY_KEY_EXISTS opcode to speed up array_key_exists() 2018-12-26 23:54:11 +03:00
Nikita Popov da1e6679b7 CFG construction: Avoid code duplication
These code for those two cases is the same nowadays, so merge them.
2018-12-17 11:29:23 +01:00
Nikita Popov 6debea2fd8 Merge branch 'PHP-7.3' 2018-12-10 13:36:54 +01: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 59cacdcefd Fix typos in compact literals debugging code 2018-12-10 13:35:55 +01:00
Nikita Popov 745e250a21 Merge branch 'PHP-7.3' 2018-11-28 20:10:32 +01:00
Nikita Popov f4eec70260 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-28 20:10:17 +01:00
Nikita Popov 17f8b9fb36 Fixed bug #77215
Remove invalid assertion: A block can have multiple switch frees,
so if we don't do live range block splitting, it is not necessarily
true that the free is located at the start of a block.
2018-11-28 20:08:39 +01:00
Dmitry Stogov ba99aa133c Fixed issues related to optimization and persitence of classes linked with interfaces, traits or internal classes. 2018-11-14 16:32:07 +03:00
Dmitry Stogov 8c7aa88e2d Fixed crash introduced by bfaf662ac2 2018-11-07 09:36:21 +03:00
Dmitry Stogov bfaf662ac2 Micro-optimization 2018-11-06 17:04:17 +03:00
Nikita Popov 429c5a0a82 Merge branch 'PHP-7.3' 2018-11-02 14:34:11 +01:00
Nikita Popov d92f7630f7 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-02 14:30:50 +01:00
Nikita Popov 4daa413898 Fixed bug #77092
Weird that this worked for so long, probably because nearly all
ext/standard functions use fast ZPP rather than ordinary ZPP.
2018-11-02 14:29:03 +01:00
Zeev Suraski 9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00