Commit graph

256 commits

Author SHA1 Message Date
Nikita Popov
e67156e967 Add missing rc1/rcn to return type initialization 2021-03-19 10:04:56 +01:00
Nikita Popov
dcac654fd5 Allow inferring narrowed return type
Even if an explicit return type is given, we might still infer
a more narrow one based on return statements. We shouldn't
pessimize this just because a type has been declared.
2021-03-18 17:11:56 +01:00
Ilija Tovilo
269c8dac1d
Implement enums
RFC: https://wiki.php.net/rfc/enumerations

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6489.
2021-03-17 19:08:03 +01:00
Nikita Popov
77ebf81492 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix refcount inference for typed properties
2021-03-16 11:18:12 +01:00
Nikita Popov
27cd7a11cb Add support for string keys in array unpacking
This adds support for:

    $array1 = ['a' => 1, 'b' => 2];
    $array2 = ['b' => 3, 'c' => 4];
    $array = [...$array1, ...$array2];
    // => ['a' => 1, 'b' => 3, 'c' => 4]

RFC: https://wiki.php.net/rfc/array_unpacking_string_keys

Closes GH-6584.
2021-02-09 10:04:27 +01:00
Nikita Popov
83be073abe Move optimizer into core
This only moves the files, adjusts the build system, exports APIs
and does minor fixups to make sure the code builds.

This does not yet try to make the optimizer usable independently
of opcache.

Closes GH-6642.
2021-01-28 10:38:25 +01:00
Renamed from ext/opcache/Optimizer/zend_inference.c (Browse further)