Commit graph

356 commits

Author SHA1 Message Date
Nikita Popov
89b2d88659 Register class before fetching parent
We want the class declaration to be available while compiling the
parent class.
2019-06-11 13:09:33 +02:00
Nikita Popov
e1c903230e Merge branch 'PHP-7.4' 2019-05-28 16:41:30 +02:00
Nikita Popov
071b389bc6 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-28 16:41:17 +02:00
Nikita Popov
817b50826e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-28 16:41:08 +02:00
Nikita Popov
59dfaa3f99 Fix type inference of SEND_UNPACK with empty array
An empty array will not be turned into an array of references.
This violated the invariant than an array has values iff it has
keys.
2019-05-28 16:40:56 +02:00
Nikita Popov
8126658444 Remove FUNC_MAY_WARN
We are no longer constructing the local symbol table when calling
error handlers since 2f1f34952e,
which was the original motivation for having this information and
was used in an earlier version of the JIT.
2019-05-28 11:23:02 +02:00
Nikita Popov
45c663a9d3 Merge branch 'PHP-7.4' 2019-05-27 17:13:00 +02:00
Nikita Popov
fd23f9104a BIND_STATIC of implicit binding may be undef
Even though we don't need it at runtime, add the BIND_IMPLICIT
flag to BIND_STATIC as well, so we can distinguish this case in
type inference.

This fixes a JIT miscompile in arrow_functions/002.phpt.
2019-05-27 17:12:20 +02:00
Nikita Popov
f106f57164 Merge branch 'PHP-7.4' 2019-05-13 14:43:10 +02:00
CHU Zhaowei
e829d08729 Implement spread operator in arrays
RFC: https://wiki.php.net/rfc/spread_operator_for_array

Closes GH-3640.
2019-05-13 14:42:43 +02:00
Dmitry Stogov
35b7dd11fd Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unused BIND_STATIC insructions
2019-04-23 02:21:45 +03:00
Dmitry Stogov
1827d784b5 Remove unused BIND_STATIC insructions 2019-04-23 02:21:08 +03:00
Dmitry Stogov
c91df3aedd Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove RC1 and RCN from scalar types.
2019-04-03 12:39:26 +03:00
Dmitry Stogov
dd4d43c97d Remove RC1 and RCN from scalar types. 2019-04-03 12:38:25 +03:00
Nikita Popov
b8866a5a0e Merge branch 'PHP-7.4' 2019-02-22 12:00:49 +01:00
Nikita Popov
4a98f42330 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-22 12:00:35 +01:00
Nikita Popov
33c2b47de3 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-22 12:00:20 +01:00
Nikita Popov
2cfb09caa7 Fix inference warning about missing key type 2019-02-22 11:55:16 +01:00
Dmitry Stogov
cdade2e35d Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove copyright years.
2019-02-05 10:33:57 +03:00
Dmitry Stogov
da919a8b65 Remove copyright years. 2019-02-05 10:33:28 +03:00
Peter Kokot
623911f993 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove local variables
2019-02-03 21:23:18 +01: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
Nikita Popov
920b4b249f Remove track_errors and $php_errormsg
This has been deprecated in PHP 7.2 as part of
https://wiki.php.net/rfc/deprecations_php_7_2.
2019-01-28 15:58:23 +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
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
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
Michael Moravec
f5044a12dd Implement ZEND_ARRAY_KEY_EXISTS opcode to speed up array_key_exists() 2018-12-26 23:54:11 +03:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Nikita Popov
3d415644f7 Merge branch 'PHP-7.3' 2018-10-25 16:44:54 +02:00
Nikita Popov
78c2e0e342 Merge branch 'PHP-7.2' into PHP-7.3 2018-10-25 16:44:19 +02:00
Nikita Popov
902ec36710 Merge branch 'PHP-7.1' into PHP-7.2 2018-10-25 16:43:36 +02:00
Nikita Popov
f1ceec5533 Fixed bug #77058
Account for the fact that undef must be interpreted as null for
the purposes of INC/DEC inference.
2018-10-25 16:37:41 +02:00
Nikita Popov
e7153e8a2f Improve "narrowing" error message
By including the opcode name.
2018-10-25 16:36:23 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Peter Kokot
7f6387b59a Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
Dmitry Stogov
689c6fb188 Replace ZEND_ACC_ANON_BOUND, ZEND_ACC_UNRESOLVED_PARENT and ZEND_ACC_UNRESOLVED_INTERFACES with single ZEND_ACC_LINKED. 2018-09-18 11:41:40 +03:00
Dmitry Stogov
6136a20544 ZEND_DECLARE_CLASS, ZEND_DECLARE_INHERITED_CLASS and ZEND_DECLARE_INHERITED_CLASS_DELAYED don't need return value anymore. 2018-08-24 15:40:53 +03:00
Dmitry Stogov
8050f4a334 Keep information about unresolved parent class in zend_class_entry->parent_name 2018-08-24 00:20:57 +03: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
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
Nikita Popov
5d7be2c2bc Merge branch 'PHP-7.2' 2018-06-30 19:50:56 +02:00
Nikita Popov
34deda13a8 Merge branch 'PHP-7.1' into PHP-7.2 2018-06-30 19:50:40 +02:00
Nikita Popov
2eb6a541a9 Fix typo in compound dim assign op inference
Thankfully a harmless one, just makes inference results worse.
2018-06-30 19:50:07 +02:00
Dmitry Stogov
1b80de93b8 Cleanup conditions 2018-06-26 16:18:30 +03:00
Dmitry Stogov
54f171cdc0 Restored zend_array_element_type() prototype 2018-06-26 11:23:37 +03:00
Nikita Popov
102bcb5c05 Update array_element_type inference for previous change
LIST_R and DIM_IS return value can't be MAY_BE_REF anymore.
2018-06-25 14:27:02 +02:00
Nikita Popov
490a49d0bb Use COPY_DEREF for DIM_IS and LIST_R as well
Also add an upgrading note for the behavior change, not that we
expect anyone to be affected...
2018-06-25 14:23:06 +02:00